Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.18 KB | None | 0 0
  1. import sys
  2. import asyncio
  3. import discord
  4. from discord.ext.commands import Bot
  5. from discord.ext import commands
  6. from time import sleep
  7. import os
  8. import random
  9. os.system("color a")
  10. author = "Glazz#4031"
  11. trigger = commands.Bot(command_prefix=".")
  12. #DISCORD LOGGING KEY
  13. def neatPrint( word ):
  14.     for char in word:
  15.         sleep(0.008)
  16.         sys.stdout.write(char)
  17.         sys.stdout.flush()
  18.     print(" ")
  19. prefix = "."
  20. @trigger.event
  21. async def on_ready():
  22.     neatPrint(">>>>>BOOTUP COMPLETE<<<<<")
  23.     neatPrint("Logged in as " + trigger.user.name)
  24.     neatPrint(">Event log")
  25.     print("_" * 34)
  26.     await trigger.change_presence(game=discord.Game(name="type .author for test"))
  27. @trigger.event
  28. async def on_message(message):
  29.     def send( x ):
  30.         return trigger.send_message(message.channel, x)
  31.         #PING COMMAND
  32.     if message.content.startswith(prefix + ("ping").lower()):
  33.         await send(":ping_pong: PONG")
  34.         pinger = str(message.author)
  35.         print(pinger +" pinged")
  36.     #HI COMMAND
  37.     elif message.content.startswith(prefix + ("hi").lower()):
  38.         saluted = str(message.author.name)
  39.         await send(str(message.author.avatar_url))
  40.         await send("Hi " + saluted.capitalize())
  41.         print(str(message.author) + " " + "said hi")
  42.         #MY DAD
  43.     elif message.content.startswith(prefix + "author") and str(message.author) == author:
  44.         await send("You")
  45.         #NOT MY DAD
  46.     elif message.content.startswith(prefix + "author"):
  47.         await send("Not you")
  48.         #SHUTDOWN COMMAND
  49.     if message.content.startswith(prefix + "shutdown") and str(message.author) == author:
  50.         await send("SHUTTING DOWN")
  51.         trigger.close()
  52.         sys.exit()
  53.     elif message.content.startswith(prefix + "shutdown") and str(message.author) != author:
  54.         await send("User lacks authority to issue Shutdown command")
  55.         await send("Have a meme instead")
  56.         await  trigger.send_file(message.channel, "E:\memes\deathnote.png")
  57.     elif message.content.startswith(prefix + "test") and str(message.author) == author:
  58.         await trigger.send_file(message.channel, "E:\memes\images_10.jpg")
  59. #DISCORD KEY
  60. trigger.run("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement