tscas.blogg.se

Pip install discord
Pip install discord






pip install discord

Things like the channel, who sent the message, etc. Each message that is sent on the Discord side will trigger this function and send a Message object that contains a lot of information about the message that was sent. The on_message() function listens for any message that comes into any channel that the bot is in. I am simply using this to do a quick little count to check how many guilds/servers the bot is connected to and some data about the guilds/servers. You can use this as a tool to log information as you see fit. The print statement will show this in your terminal: - 704974365309141042 (name: Quadriaxis's server) SampleDiscordBot is in 1 guilds. One happens when the bot starts up when the main.py is run.

pip install discord pip install discord

The on_ready() and on_message() functions are event listeners associated with the Discord bot, as noted by the annotations.








Pip install discord