Windows 10 VSCode Discord.py Python 3
Hey guys, I want my bot to send a message to a specific channel every time it logs on, here is the code:
@client.event async def on_ready(): channel = client.get_channel(788532498724290641) await channel.send('I have been updated and am now online again.')
There are no errors however no message gets sent when the program is run.
The whole program can be found here but beware it's uncommented and janky: https://github.com/DavisStanko/Discord-Bot
It's because you have multiple on_ready events. You can only have 1 type of each event, otherwise the last interpreted event will be the only one recognized. Merge the two on_ready events into 1 function.
on_ready
2.1m questions
2.1m answers
60 comments
57.0k users