def check_training(self):
await self.bot.wait_until_ready()
channel = discord.Object(id=overwatchChannelId) # SENDS TO CHANNEL OVERWATCH IN BANANA'S DISCORD
while not self.bot.is_closed:
now = datetime.datetime.now()
if now.weekday() == 0 or now.weekday() == 3:
if now.hour == 20:
role = discord.utils.find(lambda r: r.name == 'overwatch_players',
self.bot.get_server(bananasDiscordId).roles)
message = role.mention + ' Yo mes ptits poulets, oubliez pas le training de ce soir de 21h a 23h, sinon Loulou il va raler !'
await self.bot.send_message(channel, message)
elif now.weekday() == 5:
if now.hour == 15:
role = discord.utils.find(lambda r: r.name == 'overwatch_players',
self.bot.get_server(bananasDiscordId).roles)
message = role.mention + ' Yo mes ptits poulets, oubliez pas le training de cette apres-midi de 16h a 18h, sinon Loulou il va raler !'
await self.bot.send_message(channel, message)
await asyncio.sleep(3600) # task runs every hour
评论列表
文章目录