Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands, tasks
  3. import datetime
  4. from itertools import cycle
  5. import random
  6. import typing
  7.  
  8. CatMemes = ["https://www.rd.com/wp-content/uploads/2018/06/01_killing-em-with-cuteness.jpg",
  9. "https://www.rd.com/wp-content/uploads/2018/06/02_In-full-flight.jpg",
  10. "https://i1.wp.com/bestlifeonline.com/wp-content/uploads/2018/06/cat-meme-97.jpg?fit=500%2C366&ssl=1",
  11. "https://www.washingtonpost.com/resizer/2kfKeE6D8HXoL3NlNSN-SkoR1w0=/767x0/smart/arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/4ME53YUBKJAVNA4LC42XGJQNAU.jpg",
  12. "https://i.kym-cdn.com/photos/images/newsfeed/001/535/420/f87.jpg", ]
  13.  
  14. Grumpycat = [
  15. "https://i1.wp.com/www.nbc4i.com/wp-content/uploads/sites/18/2019/05/318ez5_1558120704490_87957351_ver1.0.jpg?w=2000&ssl=1",
  16. "https://ichef.bbci.co.uk/news/912/cpsprodpb/15A7C/production/_107000788_b393f35a-e6c7-4877-a05f-997b2f4a1e30.jpg",
  17. "https://i2.wp.com/www.nbc4i.com/wp-content/uploads/sites/18/2019/05/318fj2_1558120705782_87957352_ver1.0-1.jpg?w=2000&ssl=1"]
  18.  
  19. bot = commands.Bot(command_prefix='?', case_insensitive=True)
  20. user = bot.get_user(381870129706958858)
  21. bot.remove_command('help')
  22. status = cycle(['Testing stuff', 'Watching the discord', 'Being a BOT', 'Reading manga', 'UwU', 'OwO', 'Minetab!'])
  23.  
  24.  
  25. @bot.event
  26. async def on_ready():
  27. change_status.start()
  28. print('I am now online!')
  29. ans = input("When you would like to shutdown the bot, Say shutdown")
  30. if ans == ("Shutdown") or ans == ("shutdown"):
  31. print("Ok. Shutting Down.")
  32. exit()
  33. else:
  34.  
  35.  
  36.  
  37. @tasks.loop(seconds=10.0)
  38. async def change_status():
  39. await bot.change_presence(activity=discord.Game(next(status)))
  40.  
  41.  
  42. @bot.command()
  43. async def hello(ctx):
  44. await ctx.send(f"Hi! {ctx.author.mention}")
  45.  
  46.  
  47. @bot.command()
  48. async def test(ctx):
  49. await ctx.send(f"Hello {ctx.author.mention}, this is a test!")
  50.  
  51.  
  52. @bot.command()
  53. async def ping(ctx):
  54. await ctx.send("Pong!")
  55.  
  56.  
  57. @bot.command()
  58. async def ding(ctx):
  59. await ctx.send("Dong!")
  60.  
  61.  
  62. @bot.command()
  63. async def bing(ctx):
  64. await ctx.send("Bong!")
  65.  
  66.  
  67. @bot.command()
  68. async def ting(ctx):
  69. await ctx.send("Tang!")
  70.  
  71.  
  72. @bot.command()
  73. async def kill(ctx):
  74. await ctx.send(f"{ctx.author.mention}, died. R.I.P")
  75.  
  76.  
  77. @bot.command()
  78. async def beep(ctx, message_here='This is a beep test message'):
  79. await ctx.author.send(message_here)
  80.  
  81.  
  82. @bot.command()
  83. async def commands(ctx):
  84. embed = discord.Embed(title="Test Commands", description="-----------", colour=discord.Color(0xff007f),
  85. timestamp=datetime.datetime.utcnow())
  86.  
  87. embed.add_field(name="Tests", value="1. ?commands - Test Commands"
  88. "\n2. ?hello - A simple hello message"
  89. "\n3. ?test - really?"
  90. "\n4. ?ping - Pong"
  91. "\n5. ?ting - Tang"
  92. "\n-----------")
  93. embed.add_field(name="the default prefix for this bot is ?", value=f"I am in {len(bot.guilds)} Servers"
  94. "\n------------")
  95. embed.add_field(name="My Invite Link:", value="[invite link]")
  96.  
  97. embed.set_footer(text=f"Requested By: {ctx.author.name}")
  98.  
  99. await ctx.send(embed=embed)
  100.  
  101.  
  102. @bot.command()
  103. async def cat_memes(ctx):
  104. await ctx.send(random.choice(CatMemes))
  105.  
  106.  
  107. @bot.command()
  108. async def grumpycat(ctx):
  109. await ctx.send(random.choice(Grumpycat))
  110.  
  111.  
  112. @bot.command()
  113. async def union(ctx, what: typing.Union[discord.TextChannel, discord.Member]):
  114. await ctx.send(what)
  115.  
  116.  
  117. @bot.group()
  118. async def cool(ctx):
  119. """Says if a user is cool.
  120. In reality this just checks if a subcommand is being invoked.
  121. """
  122. if ctx.invoked_subcommand is None:
  123. await ctx.send('No, {0.subcommand_passed} is not cool'.format(ctx))
  124.  
  125.  
  126. @cool.command(name='bot')
  127. async def _bot(ctx):
  128. """Is the bot cool?"""
  129. await ctx.send('Yes, the bot is cool.')
  130.  
  131.  
  132. bot.run('NjUyODM1MzcyMDczNzQ2NDM3.XeuTGw.03OI_wjEuaAn3cJoJbUUW3LputU') # starts the bot and keeps it running
  133.  
  134. # This bot is called 'TestBot1' on discord
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement