discord py mute

Solutions on MaxInterview for discord py mute by the best coders in the world

showing results for - "discord py mute"
Agustín
27 May 2020
1@client.command(description="Unmutes a specified user.")
2@commands.has_permissions(manage_messages=True)
3async def unmute(ctx, member: discord.Member):
4   mutedRole = discord.utils.get(ctx.guild.roles, name="Muted")
5
6   await member.remove_roles(mutedRole)
7   await member.send(f" you have unmutedd from: - {ctx.guild.name}")
8   embed = discord.Embed(title="unmute", description=f" unmuted-{member.mention}",colour=discord.Colour.light_gray())
9   await ctx.send(embed=embed)
Nicole
16 Jan 2018
1@client.command(description="Mutes the specified user.")
2@commands.has_permissions(manage_messages=True)
3async def mute(ctx, member: discord.Member, *, reason=None):
4    guild = ctx.guild
5    mutedRole = discord.utils.get(guild.roles, name="Muted")
6
7    if not mutedRole:
8        mutedRole = await guild.create_role(name="Muted")
9
10        for channel in guild.channels:
11            await channel.set_permissions(mutedRole, speak=False, send_messages=False, read_message_history=True, read_messages=False)
12    embed = discord.Embed(title="muted", description=f"{member.mention} was muted ", colour=discord.Colour.light_gray())
13    embed.add_field(name="reason:", value=reason, inline=False)
14    await ctx.send(embed=embed)
15    await member.add_roles(mutedRole, reason=reason)
16    await member.send(f" you have been muted from: {guild.name} reason: {reason}")
17
Lea
18 Aug 2016
1#Timed mute this format: 1d, 20s, 30m, etc..
2@bot.command(aliases=['tempmute'])
3@commands.has_permission(manage_messages=True)
4async def mute(ctx, member: discord.Member=None, time=None, *, reason=None):
5if not member:
6	await ctx.send("You must mention a member to mute!")
7elif not time:
8	await ctx.send("You must mention a time!")
9else:
10	if not reason:
11   		reason="No reason given"
12    #Now timed mute manipulation
13    try:
14    	seconds = time[:-1] #Gets the numbers from the time argument, start to -1
15        duration = time[-1] #Gets the timed maniulation, s, m, h, d
16        if duration == "s":
17        	seconds = seconds * 1
18        elif duration == "m":
19        	seconds = seconds * 60
20        elif duration == "h":
21        	seconds = seconds * 60 * 60
22        elif duration == "d":
23        	seconds = seconds * 86400
24        else:
25        	await ctx.send("Invalid duration input")
26          	return
27    except Exception as e:
28    	print(e)
29        await ctx.send("Invalid time input")
30        return
31    guild = ctx.guild
32   	Muted = discord.utils.get(guild.roles, name="Muted")
33    if not Muted:
34    	Muted = await guild.create_role(name="Muted")
35        for channel in guild.channels:
36        await channel.set_permissions(mutedRole, speak=False, send_messages=False, read_message_history=True, read_messages=False)
37    await member.add_roles(Muted, reason=reason)
38    muted_embed = discord.Embed(title="Muted a user", description=f"{member.mention} Was muted by {ctx.author.mention} for {reason} to {time}")
39    await ctx.send(embed=muted_embed)
40    await asyncio.sleep(seconds)
41  	await member.remove_roles(Muted)
42    unmute_embed = discord.Embed(title="Mute over!", description=f'{ctx.author.mention} muted to {member.mention} for {reason} is over after {time}")
43    await ctx.send(embed=unmute_embed)
queries leading to this page
discord py mutediscord py mute and unmutediscordpy mute commandpython discord py mute a userembeddiscord py timed mute commandhow to make discord py mute commandhow to vc muteperson discord pyvoidstate mute discord pyhow to make mute command discord pymute people discoord pymute bot in vc discord pyhow to make bot mute itself discord pydiscord python mute memberdiscord py mute comandmute time command discord pymute bypass discord pyhow to timed mute someone using discord pydiscord py rewrite mute commanddiscordpy mute examplediscord py mute someonepython discord mute commanddiscord py time mute commandhow to mute someone discord py rewriteserver mute everyone discord pyhow to mute person discord pydiscord py mute command and unmutehow to server mute someone on discord pydiscord py mute everyonehow to code unmute on discord pythonunmute member edit discord pyhow to mute members in discord pydiscord py mute headphonesmute 2funmute members discord pydiscord bot mute command pythonwhen a user leave voice channel discord pydiscord py mute bothow to mute people discord pymute command in discord pyhow to make a mute command discord pythonmute with time discord py databasetemp mute command discord pytimed mute command discord pyhow to make a discord bot mute someone discord py dev dungeondiscord py remove mutemute 2funmute for a time discord pydiscord py un vc mutediscord py temp mutemute command discord pymute command discord bot pythonunmute command discord pythondiscord py temp mute commanddiscord py voice mute someonehow to make automute event discord pymember edit mute discord pydiscord py server mutehow to make unmute command discord pydiscor py mute commandsmute command for a time discord pythonserver mute discord bot discord pymute discord client pythonhow to make a mute command discord pyunmute command discord pydiscord py timed mutediscord py server mute someone creating a temp mute command discord pyhow to make a mute command for discord pymute time discord pydiscord py mute membermute function discord pyvoice mute discord pytimed mute discord py 21mute discord pymute member discord pytime mute code discord pydiscord bot mute people discord pyhow to make a mute command with time in discord pydiscord py mutecommandmute and unmute command discord pyhow to automatically unmute in discord pydiscord py mute userunmute discord py 2021discord py unmute a userpython discord server mutediscord py create mute rolehow to make a bot who mutes discord pymute command discord for determinate time bot pythonmute command discord pyhow to mute using python discocrddiscord py remove rolediscord py auto audio mutetemp mute code discord py mute people in discord pyuser mute discord pypython discord bot mutewhat is the code for the mute command in discord bot pythonmute example in discord pycreate mute comand discord pymute command disocrd pyhow to make a unmute command discord pydiscord py voice mutehow to mute and unmute people discord pymute command discordpyunmute discord pymute command discordpy 5cmute 2funmute discord pydiscord py mute commandserver mute python discord codemute command discord py rewritemember mute discord pymute command discord 2cpyhow to make a mute command discord pymute command discord pydiscord py mutediscord python mute commandmute command discord py 2021mute bot command discord pydiscord py unmute commanddiscord py member edit mutecreating a mute command discord pymuted embed discordhow to mute for a specific time in discord pyhow to make a unmute command discord pyhow to mute somebody for a period of time in discord pydiscord py mutecommand rewritediscord py server mute a membermute in voice member discord pysoft mute discord pydiscord py voice state 28mute 2fdeafen 29discord bot python client mutehow to make timed mute in discord pyunmute in discordcant server mute discord pymute system discord pyauto mute in discord pyserver mute discord pymute a member from voice channels so they cannot speak discord pydiscord py vc mutehow to temp mute discord pydiscord py kick 2fban 2fmute 2fwarn commandhow to make a mute command discord pyyhow to vc mute person discord pymute commmand discord pypython mute discord botmake mute command discord pymute command discord py with rolemute discord py experthow to mute discord pydiscord py mute with timeput server mute discord pydiscord py unmutediscord py mute bot codemuteun commmand discord pyhow to make an unmute command discord pyhow to make mute system discrod pyunmute member discord pythonmute command discord py timesource code to unmute someone discord pytemp mute discord pymute and unmute discord pymute for day discord pyhow to make a mute command in discord pyserver mute discord pythonhow to make a time duration for a mute command 7c discord pymute with time discord pyhow to make a discord user muter in discord pyunmute with discord pydiscord py mute in voice channeltemp mute discord py command codediscord py mute for lengthdiscord py mute protectiondiscord py mute a specific rolehow to make discord py time mute commandauto mute discord pydiscord py mute commanddiscord py member edit mutepython get mutemute someone in discord pyhow to make a mute command in discorddiscord py auto create muted rolediscord py mute command with durationmute discord py mute members discord pydiscord py mute