I want to send a message everytime when the bot gets invited to a server. It should then write something like: "Hello this is my discord bot"
So far I have this code, which produces no errors, but also doesn't send the message.
@bot.event
async def on_server_join(ctx):
for guild in bot.guilds:
for channel in guild.text_channels:
if channel.permissions_for(guild.me).say:
await ctx.message.channel.send('Hello! \n')
break
on_guild_join
, plus there is not context. The only argument should be aGuild
object representing the server you have joined. – Patrick Haugh