Discord.py: Sending messages on join?

Created on 15 Sep 2017  路  2Comments  路  Source: Rapptz/discord.py

Any idea how I can make my bot send messages once it joins a server, if that server has a default channel?

The code for sending the message is clear, I just can't find anything about how to trigger it once it joins
Sending a message to the default channel should work like this, right?

await bot.send_message(server, "This is a message")

Most helpful comment

Assuming by your example send_message code, you're using the async version of the library right?

If so, look at the documentation http://discordpy.readthedocs.io/en/latest/api.html#discord.on_server_join

All 2 comments

I use a for loop to cycle through serves for an annoucement and also use "server" as a destination, so that part should be fine. I can't help you with the join message sadly :/

Assuming by your example send_message code, you're using the async version of the library right?

If so, look at the documentation http://discordpy.readthedocs.io/en/latest/api.html#discord.on_server_join

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yolotroll101 picture Yolotroll101  路  3Comments

AraHaan picture AraHaan  路  3Comments

adhoc92 picture adhoc92  路  3Comments

reuscam picture reuscam  路  3Comments

JackL0 picture JackL0  路  3Comments