Reputation: 1
I am making a bot that mutes people when they join a vc. However, when I run the following code I receive an error about 'self' not being defined. How would I fix this?
async def join(ctx, *, member=discord.Member):
channel = ctx.author.voice.channel
await channel.connect()
await member.edit(mute=True)
Upvotes: 0
Views: 1342
Reputation: 2041
If you're inside a Class/Cog you need to pass self
as the first parameter.
async def join(self, ctx, *, member=discord.Member):
channel = ctx.author.voice.channel
await channel.connect()
await member.edit(mute=True)
Upvotes: 1