Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
on_guild_join
called when the Client either creates a server or connects to an existing one.
The rest is to get all text channels, check if text channels exist at all, and send a message to the first one.
@bot.event
async def on_guild_join(guild):
text_channels = guild.text_channels
if text_channels:
channel = text_channels[0]
await channel.send('Привет, {}!'.format(guild.name))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question