temp mute command discord py

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

showing results for - "temp mute command discord py"
Dexter
04 Sep 2016
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
Marcus
14 Sep 2019
1@bot.command()
2async def tempmute(ctx, member: discord.Member, time: int, d, *, reason=None):
3    guild = ctx.guild
4    mutedRole = discord.utils.get(guild.roles, name="Muted")
5    if not mutedRole:
6        mutedRole = await guild.create_role(name="Muted")
7
8    for channel in guild.channels:
9        await channel.set_permissions(mutedRole, speak=False, send_messages=False, read_message_history=True)
10
11    await member.add_roles(mutedRole)
12
13    embed = discord.Embed(title="TempMuted!", description=f"{member.mention} has been tempmuted.", colour=discord.Colour.light_gray())
14    embed.add_field(name="Reason:", value=reason, inline=False)
15    embed.add_field(name="Time for the mute:", value=f"{time}{d}", inline=False)
16    await ctx.send(embed=embed)
17
18    if d == "s":
19        mutetime = time
20
21    if d == "m":
22        mutetime = time*60
23
24    if d == "h":
25        mutetime = time*60*60
26
27    if d == "d":
28        mutetime = time*60*60*24
29
30    with open("TXT_FILE_PATH", "w+") as mutetimef:
31        mutetime.write(mutetime)
32    
33    while True:
34        with open("TXT_FILE_PATH", "w+") as mutetimef:
35            if int(mutetimef.read()) == 0:
36                await member.remove_roles(mutedRole)
37
38                embed = discord.Embed(title="Unmute (temp mute expired) ", description=f"Unmuted -{member.mention} ", colour=discord.Colour.light_gray())
39                await ctx.send(embed=embed)
40  
41                return
42            else:
43                mutetime -= 1
44                mutetimef.seek(0)
45                mutetimef.truncate()
46                mutetimef.write(mutetime)
47        await asyncio.sleep(1)
48
queries leading to this page
python discord server mutediscord py mute someonediscord py mute in voice channeldiscord py rewrite mute commanddiscord py mute headphonesmute discord py expertdiscord py mutemute time command discord pymute function discord pyhow to make a mute command discord pymuted embed discordmute bot in vc discord pyhow to make a time duration for a mute command 7c discord pyvoidstate mute discord pycreate mute comand discord pydiscord py remove mutediscordpy mute examplemute command discord py timeserver mute discord bot discord pymute command discord py with rolemember mute discord pyhow to mute members in discord pyhow to mute people discord pyhow to make a mute command discord pyydiscord py mute for lengthtemp mute command discord pymute command discord pyhow to make bot mute itself discord pydiscord python mute commandhow to server mute someone on discord pymute member discord pymute a member from voice channels so they cannot speak discord pytemp mute discord pymuteun commmand discord pydiscord py unmute commanddiscord py mute and unmutediscord py mutecommandmute 2funmute discord pyhow to make mute system discrod pyhow to mute someone discord py rewritehow to make a mute command discord pythonpython discord bot mutemute and unmute command discord pymute someone in discord pydiscord py timed mutediscord bot mute people discord pydiscord py mute commanddiscord py server mutediscord py remove temp mutediscord py auto audio mutehow to vc mute person discord pydiscord py mute command with durationhow to make a tempmute command discord pymake mute command discord pypython mute discord botserver mute python discord codediscord py mute with timediscord py mute a specific rolemute for day discord pymute bot command discord pyhow to mute using python discocrdhow to mute for a specific time in discord pydiscord py mute command and unmutediscord py voice mute someonediscord py voice mutehow to make a mute command discord pyhow to make automute event discord pydiscord py auto create muted rolediscord py server mute someone discord py vc mutediscord py member edit mutehow to make a discord user muter in discord pyembedtemp mute code discord py mute bypass discord pymute with time discord pytime mute code discord pypython get mutemute system discord pydiscord py mutecommand rewritewhen a user leave voice channel discord pydiscord bot mute command pythondiscord py kick 2fban 2fmute 2fwarn commandtemp mute discord py command codehow to make timed mute in discord pydiscord py mutediscord py un vc muteserver mute discord pythontimed mute discord pymute discord pydiscord py time mute commandmute command discordpy 5cdiscord py temp mute commanddiscord py mute bot codemute example in discord pydiscord bot python client mutediscord py create mute role 21mute discord pyhow to make a mute command in discord pydiscord py mute everyonehow to mute discord pydiscord py mute commandcreating a temp mute command discord pyhow to temp mute discord pyhow to make a discord bot mute someone discord py dev dungeonmute commmand discord pymute command in discord pymute people discoord pyhow to mute person discord pymute command discord bot pythonput server mute discord pyhow to make mute command discord pytimed mute command discord pydiscord py mute protectiondiscord py mute membermute command discord 2cpyhow to make a bot who mutes discord pyauto mute in discord pymute command discord pytempmute discord py commanddiscord python mute memberdiscord py mute comandserver mute discord pydiscord py mute botdiscord py member edit mutemember edit mute discord pyunmute command discord pydiscord py voice state 28mute 2fdeafen 29mute command discord py rewritemute command discord pydiscord py temp mute mute members discord pymute command discordpycreating a mute command discord pyuser mute discord pypython discord mute commandtempmute command discord pydiscord py timed mute commandwhat is the code for the mute command in discord bot pythonhow to make a mute command with time in discord pymute command discord for determinate time bot pythonmute command for a time discord pythonmute command disocrd pymute people in discord pyauto mute discord pydiscordpy mute commanddiscord py unmutetemp mute command discord py