Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands, tasks
- import datetime
- from itertools import cycle
- import random
- import typing
- CatMemes = ["https://www.rd.com/wp-content/uploads/2018/06/01_killing-em-with-cuteness.jpg",
- "https://www.rd.com/wp-content/uploads/2018/06/02_In-full-flight.jpg",
- "https://i1.wp.com/bestlifeonline.com/wp-content/uploads/2018/06/cat-meme-97.jpg?fit=500%2C366&ssl=1",
- "https://www.washingtonpost.com/resizer/2kfKeE6D8HXoL3NlNSN-SkoR1w0=/767x0/smart/arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/4ME53YUBKJAVNA4LC42XGJQNAU.jpg",
- "https://i.kym-cdn.com/photos/images/newsfeed/001/535/420/f87.jpg", ]
- Grumpycat = [
- "https://i1.wp.com/www.nbc4i.com/wp-content/uploads/sites/18/2019/05/318ez5_1558120704490_87957351_ver1.0.jpg?w=2000&ssl=1",
- "https://ichef.bbci.co.uk/news/912/cpsprodpb/15A7C/production/_107000788_b393f35a-e6c7-4877-a05f-997b2f4a1e30.jpg",
- "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"]
- bot = commands.Bot(command_prefix='?', case_insensitive=True)
- user = bot.get_user(381870129706958858)
- bot.remove_command('help')
- status = cycle(['Testing stuff', 'Watching the discord', 'Being a BOT', 'Reading manga', 'UwU', 'OwO', 'Minetab!'])
- @bot.event
- async def on_ready():
- change_status.start()
- print('I am now online!')
- ans = input("When you would like to shutdown the bot, Say shutdown")
- if ans == ("Shutdown") or ans == ("shutdown"):
- print("Ok. Shutting Down.")
- exit()
- else:
- @tasks.loop(seconds=10.0)
- async def change_status():
- await bot.change_presence(activity=discord.Game(next(status)))
- @bot.command()
- async def hello(ctx):
- await ctx.send(f"Hi! {ctx.author.mention}")
- @bot.command()
- async def test(ctx):
- await ctx.send(f"Hello {ctx.author.mention}, this is a test!")
- @bot.command()
- async def ping(ctx):
- await ctx.send("Pong!")
- @bot.command()
- async def ding(ctx):
- await ctx.send("Dong!")
- @bot.command()
- async def bing(ctx):
- await ctx.send("Bong!")
- @bot.command()
- async def ting(ctx):
- await ctx.send("Tang!")
- @bot.command()
- async def kill(ctx):
- await ctx.send(f"{ctx.author.mention}, died. R.I.P")
- @bot.command()
- async def beep(ctx, message_here='This is a beep test message'):
- await ctx.author.send(message_here)
- @bot.command()
- async def commands(ctx):
- embed = discord.Embed(title="Test Commands", description="-----------", colour=discord.Color(0xff007f),
- timestamp=datetime.datetime.utcnow())
- embed.add_field(name="Tests", value="1. ?commands - Test Commands"
- "\n2. ?hello - A simple hello message"
- "\n3. ?test - really?"
- "\n4. ?ping - Pong"
- "\n5. ?ting - Tang"
- "\n-----------")
- embed.add_field(name="the default prefix for this bot is ?", value=f"I am in {len(bot.guilds)} Servers"
- "\n------------")
- embed.add_field(name="My Invite Link:", value="[invite link]")
- embed.set_footer(text=f"Requested By: {ctx.author.name}")
- await ctx.send(embed=embed)
- @bot.command()
- async def cat_memes(ctx):
- await ctx.send(random.choice(CatMemes))
- @bot.command()
- async def grumpycat(ctx):
- await ctx.send(random.choice(Grumpycat))
- @bot.command()
- async def union(ctx, what: typing.Union[discord.TextChannel, discord.Member]):
- await ctx.send(what)
- @bot.group()
- async def cool(ctx):
- """Says if a user is cool.
- In reality this just checks if a subcommand is being invoked.
- """
- if ctx.invoked_subcommand is None:
- await ctx.send('No, {0.subcommand_passed} is not cool'.format(ctx))
- @cool.command(name='bot')
- async def _bot(ctx):
- """Is the bot cool?"""
- await ctx.send('Yes, the bot is cool.')
- bot.run('NjUyODM1MzcyMDczNzQ2NDM3.XeuTGw.03OI_wjEuaAn3cJoJbUUW3LputU') # starts the bot and keeps it running
- # This bot is called 'TestBot1' on discord
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement