-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtraining.py
More file actions
35 lines (25 loc) · 787 Bytes
/
training.py
File metadata and controls
35 lines (25 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import asyncio
import logging
from discord import Intents
from discord.ext import commands
from cheems.config import config, load_config
from cheems.markov import models_xml
from cheems.trainer import CheemsTrainer
logger = logging.getLogger('training')
models_xml.load_models()
intents = Intents.default()
intents.messages = True
intents.message_content = True
bot = commands.Bot(command_prefix='.', intents=intents)
trainer = CheemsTrainer(bot)
@bot.event
async def on_ready():
logger.info(f'{bot.user} successfully logged in for training!')
trainer.begin_training()
async def main():
bot.remove_command('help')
load_config('config.yaml')
async with bot:
await bot.start(config['discord_token'])
if __name__ == '__main__':
asyncio.run(main())