Advertisement
Guest User

test

a guest
Feb 23rd, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. #importation des API
  2. import discord
  3. import asyncio
  4. from discord import ext
  5. from ext import commands
  6. from discord import utils
  7. from discord.utils import get
  8.  
  9.  
  10. client = discord.Client()
  11. duration = 0
  12.  
  13. #ban
  14. @client.command()
  15. @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
  16. async def ban (ctx, member:discord.User=None, reason =None):
  17. if member == None or member == ctx.message.author:
  18. await ctx.channel.send("Bien tenté . Mais non , raté . ")
  19. return
  20. if reason == None:
  21. reason = "Abus offert"
  22. message = f"Tu as été banni du serveur {ctx.guild.name} pour la raison : {reason}"
  23. if reason == "":
  24. message = f"Tu as été banni du serveur {ctx.guild.name} pour la raison : {reason}"
  25. await member.send(message)
  26. #await ctx.guild.ban(member, reason = reason)
  27. await ctx.channel.send(f"{member} est banni !")
  28.  
  29. #kick
  30. @client.command()
  31. @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
  32. async def kick (ctx, member:discord.User=None, reason =None):
  33. if member == None or member == ctx.message.author:
  34. await ctx.channel.send("Bien tenté . Mais non , raté . ")
  35. return
  36. if reason == None:
  37. reason = "Abus offert"
  38. message = f"Tu as été exclus du serveur {ctx.guild.name} pour la raison : {reason}"
  39. if reason == "":
  40. message = f"Tu as été exclus du serveur {ctx.guild.name} pour la raison : {reason}"
  41. await member.send(message)
  42. # await ctx.guild.kick(member, reason=reason)
  43. await ctx.channel.send(f"{member} est kické !")
  44. @client.command()
  45. @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
  46.  
  47. async def check (ctx, member:discord.User=None, reason =None)
  48.  
  49. @client.command()
  50. @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
  51. async def mute (ctx, member:discord.User=None, reason =None ,duration=None):
  52. if member == None or member == ctx.message.author:
  53. await ctx.channel.send("Bien tenté . Mais non , raté . ")
  54. return
  55. if reason == None:
  56. if reason == None:
  57. reason = "Abus offert"
  58. role = discord.utils.get(ctx.guild.roles , name='Mute')
  59. await member.add_roles(role)
  60. await ctx.send(f"Tu as été muté pour une durée de " + {duration} + "secondes pour la raison suivante : " + {reason} )
  61. async.sleep(duration)
  62. await bot.remove.roles(role)
  63.  
  64. async def mute ()
  65. @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
  66.  
  67. #events
  68. @client.event
  69. async def on_ready();
  70. print('hello')
  71. await client.change_presence(game=discord.Game(name="Mod1"))
  72. bot = commands.Bot(command_prefix = "!")
  73. #ban confirmation
  74. @bot.command(pass_context = True)
  75. async def ban(member: discord.Member, days: int = 1):
  76. if "449706643710541824" in [role.id for role in message.author.roles]:
  77. await bot.ban(member, days)
  78. else:
  79. await bot.say("You don't have permission to use this command.")
  80.  
  81. #kick confirmation
  82. @bot.command(pass_context = True)
  83. async def kick(member: discord.Member, days: int = 1):
  84. if "449706643710541824" in [role.id for role in message.author.roles]:
  85. await bot.kick(member, days)
  86. else:
  87. await bot.say("You don't have permission to use this command.")
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234. #bot run
  235. bot.run("<TOKEN>")"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement