Advertisement
Jopo2010

Untitled

Nov 11th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. @checks.mod_or_permissions(administrator=True)
  2. @mute.command(name="gulag",pass_context=True, no_pm=True)
  3. async def server_mute(self, ctx, user : discord.Member, *, reason: str = None):
  4. """Mutes user in the server"""
  5. author = ctx.message.author
  6. server = ctx.message.server
  7.  
  8. if not self.is_allowed_by_hierarchy(server, author, user):
  9. await self.bot.say("I cannot let you do that. You are "
  10. "not higher than the user in the role "
  11. "Government.")
  12. return
  13.  
  14. register = {}
  15. for channel in server.channels:
  16. if channel.type != discord.ChannelType.text:
  17. continue
  18. overwrites = channel.overwrites_for(user)
  19. if overwrites.send_messages is False:
  20. continue
  21. register[channel.id] = overwrites.send_messages
  22. overwrites.send_messages = False
  23. try:
  24. await self.bot.edit_channel_permissions(channel, user,
  25. overwrites)
  26. except discord.Forbidden:
  27. await self.bot.say("Failed to gulag user. I need the manage roles "
  28. "permission and the user I'm gulag must be "
  29. "lower than myself in the Goverment.")
  30. return
  31. else:
  32. await asyncio.sleep(0.1)
  33. if not register:
  34. await self.bot.say("That user is already gulagged in all channels")
  35. return
  36. self._perms_cache[user.id] = register
  37. dataIO.save_json("data/mod/perms_cache.json", self._perms_cache)
  38. await self.new_case(server,
  39. action="SMUTE",
  40. mod=author,
  41. user=user,
  42. reason=reason)
  43. em = discord.Embed(title='Gulagger', description='{} was gulagged'.format(user.mention,user.id), colour=0xDEADBF)
  44. 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)
  45. em.set_image(url="https://media1.tenor.com/images/834bfaf837832823da48931e69b84c14/tenor.gif")
  46. em.add_field(name="The van speeds off into the night.", value="And {} was never seen again.".format(user.name), inline=False)
  47. em.add_field(name="Gulag Successful", value="Putin laughs as {} is forced to work".format(user.mention), inline=False)
  48. em.set_author(name='Toxics Bot', icon_url="https://cdn.discordapp.com/attachments/485170641050402816/486590618903117834/toxicsbot.png")
  49. await self.bot.send_message(ctx.message.channel, embed=em)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement