How to define guild in discord.py?
async def find_channel(guild): for c in guild.text_channels: if not c.permissions_for(guild.me).send_messages: continue return c @bot.event async def on_server_join(member): channel = await find_channel(guild) await channel.send('blah') This is my code and when I start the bot and it joins to the channel, this error occurs: line 48, in on_server_join channel = await find_channel(guild) NameError: name 'guild' is not defined How can I define guild?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.