Skip to content

Commit

Permalink
Do a bit more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nfaltermeier committed Apr 7, 2022
1 parent a1fb988 commit a929bcb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ async def on_thread_join(thread):
logging.info(f'{datetime.now(timezone.utc)} Joined thread {thread.name}')
await thread.join()

# https://discordpy.readthedocs.io/en/stable/api.html?highlight=react#discord.RawReactionActionEvent

@client.event
async def on_message(message):
try:
Expand All @@ -58,6 +56,5 @@ async def on_message(message):
logging.exception(f'{datetime.now(timezone.utc)} main on_message failed')
await message.channel.send("Something went wrong :(")


load_dotenv()
client.run(os.getenv('DISCORD_TOKEN'))
4 changes: 1 addition & 3 deletions src/donut.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,4 @@ async def on_message(message, conf, client):
except discord.HTTPException as result:
if result.status == 403 and conf.strict_donuts:
await message.delete()
bot_response = await message.channel.send("Donut be naughty...")
await asyncio.sleep(10)
await bot_response.delete()
bot_response = await message.channel.send("Donut be naughty...", delete_after=10)

0 comments on commit a929bcb

Please sign in to comment.