From f724bb39c20a750876c93706903babdd5fc0e385 Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Wed, 26 Oct 2022 14:50:36 +0200 Subject: [PATCH] 2.0 update for discordpy --- Bot.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Bot.py b/Bot.py index b65f7d5..53efae9 100644 --- a/Bot.py +++ b/Bot.py @@ -6,15 +6,21 @@ import configparser from discord.ext import commands -bot = commands.Bot(command_prefix=commands.when_mentioned_or('!'), description='Hourglass, bot that does timers', pm_help=True) +async def add_cogs(bot): + await bot.add_cog(Timer.Timer(bot)) + +intents = discord.Intents.default() +intents.message_content = True + +bot = commands.Bot(command_prefix=commands.when_mentioned_or('!'), description='Hourglass, bot that does timers', intents=intents, pm_help=True) #Read configuration file: config = configparser.ConfigParser() config.read('settings.ini') -bot.add_cog(Timer.Timer(bot)) @bot.event async def on_ready(): + await add_cogs(bot) print('Logged in as:\n{0} (ID: {0.id})'.format(bot.user)) bot.run(config["tokens"]["bot"])