Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #importation des API
- import discord
- import asyncio
- from discord import ext
- from ext import commands
- from discord import utils
- from discord.utils import get
- client = discord.Client()
- duration = 0
- #ban
- @client.command()
- @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
- async def ban (ctx, member:discord.User=None, reason =None):
- if member == None or member == ctx.message.author:
- await ctx.channel.send("Bien tenté . Mais non , raté . ")
- return
- if reason == None:
- reason = "Abus offert"
- message = f"Tu as été banni du serveur {ctx.guild.name} pour la raison : {reason}"
- if reason == "":
- message = f"Tu as été banni du serveur {ctx.guild.name} pour la raison : {reason}"
- await member.send(message)
- #await ctx.guild.ban(member, reason = reason)
- await ctx.channel.send(f"{member} est banni !")
- #kick
- @client.command()
- @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
- async def kick (ctx, member:discord.User=None, reason =None):
- if member == None or member == ctx.message.author:
- await ctx.channel.send("Bien tenté . Mais non , raté . ")
- return
- if reason == None:
- reason = "Abus offert"
- message = f"Tu as été exclus du serveur {ctx.guild.name} pour la raison : {reason}"
- if reason == "":
- message = f"Tu as été exclus du serveur {ctx.guild.name} pour la raison : {reason}"
- await member.send(message)
- # await ctx.guild.kick(member, reason=reason)
- await ctx.channel.send(f"{member} est kické !")
- @client.command()
- @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
- async def check (ctx, member:discord.User=None, reason =None)
- @client.command()
- @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
- async def mute (ctx, member:discord.User=None, reason =None ,duration=None):
- if member == None or member == ctx.message.author:
- await ctx.channel.send("Bien tenté . Mais non , raté . ")
- return
- if reason == None:
- if reason == None:
- reason = "Abus offert"
- role = discord.utils.get(ctx.guild.roles , name='Mute')
- await member.add_roles(role)
- await ctx.send(f"Tu as été muté pour une durée de " + {duration} + "secondes pour la raison suivante : " + {reason} )
- async.sleep(duration)
- await bot.remove.roles(role)
- async def mute ()
- @commands.has_any_role("Our Son Bengyver","DiscordStaff","Modo Twiitch", "Modération")
- #events
- @client.event
- async def on_ready();
- print('hello')
- await client.change_presence(game=discord.Game(name="Mod1"))
- bot = commands.Bot(command_prefix = "!")
- #ban confirmation
- @bot.command(pass_context = True)
- async def ban(member: discord.Member, days: int = 1):
- if "449706643710541824" in [role.id for role in message.author.roles]:
- await bot.ban(member, days)
- else:
- await bot.say("You don't have permission to use this command.")
- #kick confirmation
- @bot.command(pass_context = True)
- async def kick(member: discord.Member, days: int = 1):
- if "449706643710541824" in [role.id for role in message.author.roles]:
- await bot.kick(member, days)
- else:
- await bot.say("You don't have permission to use this command.")
- #bot run
- bot.run("<TOKEN>")"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement