0

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)
1
  • Are you doing this inside the cogs? If you are, just try to put the first parameter self. Commented Sep 20, 2020 at 17:23

1 Answer 1

1

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)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.