#how to issue a timeout

1 messages · Page 1 of 1 (latest)

dim light
#
@bot.command()
@commands.has_permissions(moderate_members=True)
async def timeout(ctx: commands.Context, member: disnake.Member):
    await member.timeout(datetime.timedelta(hours=1), reason=f"Requested by {ctx.author}")
    await ctx.send(f"I've timed out {member.mention} for 1 hour.")
pallid kettleBOT
#

Many times I tried to find the code for the timeout, but could not, not one works...

#

так же был код py @bot.slash_command(name='timeout', description='timeouts a user for a specific time') @commands.has_permissions(moderate_members=True) async def timeout(interaction, member: disnake.Member, seconds: int = 0, minutes: int = 0, hours: int = 0, days: int = 0, reason=None): duration=datetime.timedelta(seconds=seconds, minutes=minutes, hours= hours, days=days) await member.timeout(duration, reason=reason) await interaction.response.send_message(f'{member.mention} was timeouted until for {duration}', ephemeral=True)

dim light
dim light
#

@spare frigate

#

help pls((

pallid kettleBOT
#

It's just so much time and no one has helped me(

spare frigate
#

try .timeout(duration=duration), you need to explicitly specify the kwarg

pallid kettleBOT
#

Trying

dim light