Advertisement
Guest User

Untitled

a guest
May 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. import discord
  2. import random as r
  3. import time
  4.  
  5. TOKEN = 'NDQ5MDY3NzY4MDA5MTk1NTMw.DefTKQ.l2YKFjq4iXUgFT8Nmaw3f3kQ9U0'
  6.  
  7.  
  8.  
  9.  
  10.  
  11. #todo, Make a !help command
  12.  
  13.  
  14. client = discord.Client()
  15. master = "Sadist, not Satyr#8429"
  16. @client.event
  17. async def on_message(message):
  18. # we do not want the bot to reply to itself
  19. if message.author == client.user:
  20. return
  21. try:
  22. if message.content.startswith('!hello'):
  23. msg = 'Hello {0.author.mention}'.format(message)
  24. await client.send_message(message.channel, msg)
  25.  
  26. if message.content.startswith('!test'):
  27. print(message.author)
  28. if str(message.author) == str(master):
  29. msg = 'Hello Master!'.format(message)
  30. await client.send_message(message.channel, msg)
  31. else:
  32. await client.send_message(message.channel, 'Ummm, Im sorry, Who are you again?')
  33.  
  34. if message.content == ('!master'):
  35. if str(message.author) == str(master):
  36. msg = 'You are my master~!'.format(message)
  37. await client.send_message(message.channel, msg)
  38. else:
  39. await client.send_message(message.channel, master + ' is my master!\n But I like you too...')
  40.  
  41. if str(message.content).lower() == ('goodnight bot'):
  42. await client.send_message(message.channel, 'Goodnight Human.')
  43.  
  44. msgsplit = str(message.content).split(' ')
  45. if 'suicide' in msgsplit:
  46. await client.send_message(message.channel, 'Hey you shouldnt joke about that!')
  47.  
  48. if 'kill' in msgsplit and ('yourself' in msgsplit or 'urself' in msgsplit):
  49. await client.send_message(message.channel, 'That is not nice to say')
  50.  
  51. if msgsplit[0].lower() == 'im' or msgsplit[0].lower() == "i'm":
  52. if len(msgsplit) < 5:
  53. msg = 'Hi ' + str(message.content)[str(message.content).find(' ')+1:] + "! I'm " + client.user.name
  54. await client.send_message(message.channel, msg)
  55.  
  56. if message.content.startswith('!flip'):
  57. if r.randrange(2) == 0:
  58. await client.send_message(message.channel, 'The coin was HEADS')
  59. else:
  60. await client.send_message(message.channel, 'The coin was TAILS')
  61.  
  62. if msgsplit[0].lower() == '!owo':
  63. msg = str(message.content)[str(message.content).find(' '):].replace('l','w')
  64. msg = msg.replace('r','w')
  65. msg = msg.replace('q','qw')
  66. await client.send_message(message.channel, msg + ' CwC OwO')
  67.  
  68. except NameError:
  69. msg = 'OOPSIE WOOPSIE!! Uwu We made a fucky wucky!! \nA wittle fucko boingo! The code monkeys at our headquarters are working VEWY HAWD to fix this!'.format(message)
  70. await client.send_message(message.channel, msg)
  71.  
  72. @client.event
  73. async def on_ready():
  74. print('Logged in as')
  75. print(client.user.name)
  76. print(client.user.id)
  77. print('------')
  78.  
  79. client.run(TOKEN)
  80.  
  81.  
  82. #Read the Docs
  83. #https://discordpy.readthedocs.io/en/latest/api.html
  84.  
  85.  
  86.  
  87. #############################################################
  88. ## How to auth check
  89.  
  90. # if str(message.author) == str(master):
  91.  
  92. ## How to have bot @ mention
  93.  
  94. # msg = 'Hello {0.author.mention}'.format(message)
  95. # await client.send_message(message.channel, msg)
  96.  
  97. ## How to message
  98.  
  99. # wait client.send_message(message.author, 'You a bitch')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement