How do I run the DiscordClient().announceChallenge() every day at 14:00 with the bot/script running 24/7?
imports
class DiscordClient(discord.Client):
def __init__(self):
super().__init__()
async def on_ready(self):
print('Logged on as {0}!'.format(self.user))
async def announceChallenge(self):)
print("Announced the daily challenge")
client = DiscordClient()
client.run(token)```
Read the docs about the sched module .
Here is a simple tutorial.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.