SHARE
TWEET

Untitled

a guest May 25th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import discord
  2. from discord.ext.commands import Bot
  3. import json
  4. import os
  5. from discord.ext import commands
  6.  
  7.  
  8. TOKEN = 'NTgxNTcyODgzNjUwNzA3NDg3.XOh7gA.jIZhTVdqSodeK7zrkut1Cl1VD7E'
  9. client = commands.Bot(command_prefix = ':')
  10. client.remove_command("help")
  11.  
  12.  
  13. @client.event
  14. async def on_ready():
  15.     print("ready")
  16.     await client.change_presence(activity=discord.Game(name = ":help | LAG V0.1"))
  17.  
  18.  
  19. @client.command()
  20. @commands.has_permissions(administrator=True)
  21. async def kick(ctx, member:discord.Member = None):
  22.     if not member:
  23.         await ctx.send("Please specify a member")
  24.         return
  25.     await member.kick()
  26.     await ctx.send(f"{member.mention} got kicked")
  27. @kick.error
  28. async def kick_error(ctx, error):
  29.     if isinstance(error, commands.CheckFailure):
  30.         await ctx.send("You are not allowed to kick people")
  31.  
  32. @client.command()
  33. @commands.has_permissions(administrator=True)
  34. async def ban(ctx, member:discord.Member = None):
  35.     if not member:
  36.         await ctx.send("Please specify a member")
  37.         return
  38.     await member.ban()
  39.     await ctx.send(f"{member.mention} got ban")
  40. @ban.error
  41. async def kick_error(ctx, error):
  42.     if isinstance(error, commands.CheckFailure):
  43.         await ctx.send("You are not allowed to ban people")
  44.  
  45. @client.command()
  46. @commands.has_permissions(administrator=True)
  47. async def mute(ctx, member: discord.Member=None):
  48.     if not member:
  49.         await ctx.send("Please specify a member")
  50.         return
  51.     role = discord.utils.get(ctx.guild.roles, name="muted")
  52.     await member.add_roles(role)
  53. @mute.error
  54. async def mute_error(ctx, error):
  55.     if isinstance(error, commands.CheckFailure):
  56.         await ctx.send("You are not allowed to mute people")
  57.  
  58.  
  59. @client.command()
  60. @commands.has_permissions(administrator=True)
  61. async def unmute(ctx, member: discord.Member=None):
  62.     if not member:
  63.         await ctx.send("Please specify a member")
  64.         return
  65.     role = discord.utils.get(ctx.guild.roles, name="muted")
  66.     await member.remove_roles(role)
  67. @mute.error
  68. async def unmute_error(ctx, error):
  69.     if isinstance(error, commands.CheckFailure):
  70.         await ctx.send("You are not allowed to unmute people")
  71.  
  72.  
  73. @client.event
  74. async def on_member_join(member):
  75.     channel = discord.utils.get(member.guild.channels, name= "welcome")
  76.     await channel.send(f'Welcome, {member.mention}! ')
  77.     role = discord.utils.get(member.guild.roles, name = "Member")
  78.     await member.add_roles(role)
  79.  
  80.  
  81.  
  82. @client.command()
  83. async def help(ctx):
  84.     await ctx.send("Hello. And thanks for using Language Arts Grade! Our commands are : ```:ban```, ```:kick```, ```:mute```, and more fun commands to come!")
  85.  
  86.  
  87.  
  88. client.run(TOKEN)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top