Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @checks.mod_or_permissions(administrator=True)
- @mute.command(name="gulag",pass_context=True, no_pm=True)
- async def server_mute(self, ctx, user : discord.Member, *, reason: str = None):
- """Mutes user in the server"""
- author = ctx.message.author
- server = ctx.message.server
- if not self.is_allowed_by_hierarchy(server, author, user):
- await self.bot.say("I cannot let you do that. You are "
- "not higher than the user in the role "
- "Government.")
- return
- register = {}
- for channel in server.channels:
- if channel.type != discord.ChannelType.text:
- continue
- overwrites = channel.overwrites_for(user)
- if overwrites.send_messages is False:
- continue
- register[channel.id] = overwrites.send_messages
- overwrites.send_messages = False
- try:
- await self.bot.edit_channel_permissions(channel, user,
- overwrites)
- except discord.Forbidden:
- await self.bot.say("Failed to gulag user. I need the manage roles "
- "permission and the user I'm gulag must be "
- "lower than myself in the Goverment.")
- return
- else:
- await asyncio.sleep(0.1)
- if not register:
- await self.bot.say("That user is already gulagged in all channels")
- return
- self._perms_cache[user.id] = register
- dataIO.save_json("data/mod/perms_cache.json", self._perms_cache)
- await self.new_case(server,
- action="SMUTE",
- mod=author,
- user=user,
- reason=reason)
- em = discord.Embed(title='Gulagger', description='{} was gulagged'.format(user.mention,user.id), colour=0xDEADBF)
- em.add_field(name="Three men drive up in a black van.", value="They hop out and drag {} into the back of the van while shouting ГУЛАГ ВРЕМЯ !!! ГУЛАГ ВРЕМЯ !!!".format(user.name), inline=False)
- em.set_image(url="https://media1.tenor.com/images/834bfaf837832823da48931e69b84c14/tenor.gif")
- em.add_field(name="The van speeds off into the night.", value="And {} was never seen again.".format(user.name), inline=False)
- em.add_field(name="Gulag Successful", value="Putin laughs as {} is forced to work".format(user.mention), inline=False)
- em.set_author(name='Toxics Bot', icon_url="https://cdn.discordapp.com/attachments/485170641050402816/486590618903117834/toxicsbot.png")
- await self.bot.send_message(ctx.message.channel, embed=em)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement