Brandon12121

code

Jun 15th, 2021
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.44 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3. from discord.ext import tasks
  4. import random
  5.  
  6.  
  7. client = discord.Client
  8.  
  9. bot = commands.Bot(command_prefix='.')
  10.  
  11.  
  12. @bot.event
  13. async def on_ready():
  14.     await bot.change_presence(status=discord.Status.idle, activity=discord.Game('beeing useul bot'))
  15.     print("bot is ready")
  16.  
  17.  
  18.  
  19.  
  20. @bot.command()
  21. async def clear(ctx,amount=5):
  22.     await ctx.channel.purge(limit=amount)
  23.  
  24. @bot.command()
  25. async def kick(ctx, member : discord.Member, *, reason=None):
  26.     await member.kick(reason=reason)
  27.  
  28. @bot.command()
  29. async def ban(ctx, member : discord.Member, *, reason=None):
  30.     await member.ban(reason=reason)
  31.     await ctx.send(f'unbanned {member.mention}')
  32.  
  33.  
  34.  
  35. @bot.command()
  36. async def unban(ctx, *, member ):
  37.     banned_users = await ctx.guild.bans()
  38.     member_name, member_discriminator = member.split('#')
  39.  
  40.     for ban_entry  in banned_users:
  41.         user = ban_entry.user
  42.  
  43.         if (user.name, user.discriminator) == (member_name, member_discriminator):
  44.             await ctx.guild.unban(user)
  45.             await ctx.send(f'unbanned {user.mention}')
  46.             return
  47.  
  48. @bot.command()
  49. async def ping(ctx):
  50.     await ctx.send(f'pong! {round(bot.latency * 1000)}ms')
  51.  
  52. @bot.command()
  53. async def subtokb(ctx):
  54.     await ctx.send(f'https://www.youtube.com/channel/UCjvsW1TlOZieLeuHrUUT3JA')
  55.  
  56.  
  57.  
  58. @bot.command(aliases=['8ball'])
  59. async def _8ball(ctx, *, question):
  60.   responses = [
  61.             "It is certain.",
  62.             "It is decidedly so.",
  63.             "Without a doubt.",
  64.             "Yes - definitely.",
  65.             "You may rely on it.",
  66.             "As I see it, yes.",
  67.             "Most likely.",
  68.             "Outlook good.",
  69.             "Yes.",
  70.             "Signs point to yes.",
  71.             "Reply hazy, try again.",
  72.             "Ask again later.",
  73.             "Better not tell you now.",
  74.             "Cannot predict now.",
  75.             "Concentrate and ask again.",
  76.             "Don't count on it.",
  77.             "My reply is no.",
  78.             "My sources say no.",
  79.             "Outlook not so good.",
  80.             "Very doubtful."]
  81.  
  82.   await ctx.send(f'Question: {question}\nAnswer: {random.choice(responses)}')
  83.  
  84.  
  85. @bot.event
  86. async def on_ready():
  87.     print("bot is ready")
  88.  
  89.  
  90. @bot.event
  91. async def on_member_join(member):
  92.     print(f'{member} has joined he sever.')
  93.  
  94. @bot.event
  95. async def on_member_remove(member):
  96.     print(f'{member} has left hm sever')
  97.  
  98. bot.run("123")
Advertisement
Add Comment
Please, Sign In to add comment