Ask coding questions

← Back to all posts
Discord.py mute
makxspa (6)

How make mute command?If you can, please explain it to me because many solutions from the Internet do not work.

Answered by 19wintersp (1142) [earned 5 cycles]
View Answer
Comments
hotnewtop
19wintersp (1142)

You should use add_roles to give the recipient a role which is muted (which you need to create, either manually or with create_role).

makxspa (6)

@19wintersp I improved my design according to the youtube tutorial but there is a bug anyway. Could you point me out wrongly and write the corrected version?

19wintersp (1142)

@makxspa You've assigned client twice, on line 11 and 12. Try renaming line 11 to bot and changing it accordingly on line 18.

makxspa (6)

@19wintersp I changed my name to bot but I don't know how to correct line 18 anyway.

19wintersp (1142)

@makxspa Don't remove line 11; rename the variable:

Try renaming line 11 to bot

makxspa (6)

@19wintersp Maybe he formulates the question differently. Copy the entire main.py code, correct it and send it back because I don't understand it.

19wintersp (1142)

@makxspa Maybe who formulates the question differently? And if you don't understand the code you're writing, that's very bad. I'm not going to do this for you. Copy-pasting code you don't understand is an awful way to do things.

makxspa (6)

@19wintersp You're right, it's the wrong way. I read it again and corrected it. No error occurs but after typing in discord: mute @MEMBER nothing happens. I guess I'm making a mistake in writing to discord. What is going on?

19wintersp (1142)

@makxspa Should it be alieses or aliases on line 19? I don't know if that'll fix it, was just wondering.

19wintersp (1142)

@makxspa Does this mute, or unmute people? You seem to be removing muted_role, is that intentional?

makxspa (6)

@19wintersp I've tried both, but both don't work

19wintersp (1142)

@makxspa I'm sorry, I don't know what to do; debugging a Discord bot as an onlooker is practically impossible.

makxspa (6)

@19wintersp Right, I looked through a dozen guides and nothing. I think I will give up. Thanks for your help.