CodeMastr3 / hackbot

Discord bot for Hackathon
4 stars 14 forks source link

Have bot post a message when it comes online #40

Open Ramsfield opened 3 years ago

Ramsfield commented 3 years ago

It might be helpful (especially with the introduction of !update) to have the bot send a message in specific channels upon wakeup

ZenKitty commented 2 years ago

Technically possible with on_ready event handler, but in testing I've found that the event handler will trigger multiple times with even slight network connection hiccups. Could get around it by setting a flag so it only prints a message on startup though. I'll see if there's a more elegant solution.

CodeMastr3 commented 2 years ago

@ZenKitty Have you tried https://discordpy.readthedocs.io/en/stable/api.html?highlight=bot#discord.Client.wait_until_ready