#๐Ÿ”’ Need help about timeout

5 messages ยท Page 1 of 1 (latest)

warped karma
#

Hello so I just writed a timeout code but when I typed !timeout @warped karma 15 it won`t timeout and it prints 1 to the console hope you can help me about it.
Here is my code:

    @commands.command()
    @commands.has_permissions(moderate_members=True)
    async def timeout(self, ctx, member: discord.Member, time: int, *, reason=None):
        if time < 1 or time > 2419200:
            conf_embed = discord.Embed(title="Error!", color=discord.Color.red(), timestamp=datetime.utcnow())
            conf_embed.add_field(name="Invaild Duration:", value="The duration should between **1** and **2419200**", inline=False)

            await ctx.send(embed=conf_embed)
            return
        print(1)
        await member.timeout(duration=time, reason=reason)
        print(2)
        await ctx.send(f"Timed out {member.mention} for {time} seconds")
        print(3)
brave coveBOT
#

@warped karma

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

warped karma
#

Need help about timeout members

brave coveBOT
#

@warped karma

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.