Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14243

discord python timeout . Error: Member.edit() got an unexpected keyword argument 'communication_disabled_until'

$
0
0
@bot.hybrid_command(name="mute", description="Time out a member in the server.")@app_commands.describe(member="The member to time out", duration="Time out duration in minutes", reason="Reason for the time out")@commands.has_permissions(moderate_members=True)async def mute(ctx, member: discord.Member, duration: int, *, reason: str = "No reason provided"):    if member.is_timed_out():        await send_embed(ctx, "Error", f"{member.display_name} is already timed out.")        return    end_time = datetime.utcnow() + timedelta(minutes=duration)    try:        await member.edit(communication_disabled_until=end_time, reason=reason)        await send_embed(ctx, "Success", f"{member.display_name} has been timed out for {duration} minutes. Reason: {reason}")    except Exception as e:        await send_embed(ctx, "Error", f"Failed to time out {member.display_name}. Error: {str(e)}")

ErrorFailed to time out USER. Error: Member.edit() got an unexpected keyword argument 'communication_disabled_until'

i tried communication_disabled_until and timeout but both didnt work


Viewing all articles
Browse latest Browse all 14243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>