Discord.py Discussion #7206
-
Hello, I am currently using discord.py library to make the mute command. When i typed this mute command in my discord server: s.mute 2h Testing (here my bot's prefix is "s." and i want to mute a user for 2 hours with the reason 'Testing'), my bot did not send any message showing that someone is just muted, it just gave the user who was muted the Muted role. Also, there was no error in the code terminal after I ran the mute command. I really dont know what i did wrong, could someone help me? I'll be very thankful.
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Change |
Beta Was this translation helpful? Give feedback.
-
And change |
Beta Was this translation helpful? Give feedback.
-
units = ['s', 'm', 'h', 'd']
time_unit = time_mute[-1] Will likely not work. return is a statement. If you use that then your function will end at that point, meaning that your bot will not send any messages. Consider using a variable to define |
Beta Was this translation helpful? Give feedback.
-
You have a few things going on here which you probably want to change.
|
Beta Was this translation helpful? Give feedback.
-
Why not run this code line-by-line with a debugger and see which line stops this code? And isn't |
Beta Was this translation helpful? Give feedback.
Change
asyncio.sleep(total_secs)
toawait asyncio.sleep(total_secs)
, asyncio.sleep is a coroutine