Advertisement
Guest User

NIGERIOS

a guest
Jan 19th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.39 KB | None | 0 0
  1. import discord
  2. import logging
  3. import asyncio
  4. import urllib.request
  5. import sys
  6.  
  7. from random import random, randrange
  8.  
  9. logger = logging.getLogger('discord')
  10. logger.setLevel(logging.DEBUG)
  11.  
  12. handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
  13. handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s:%(message)s'))
  14. logger.addHandler(handler)
  15.  
  16. client = discord.Client()
  17.  
  18. token = 'MjU0ODI5NjQzNTY2Mjg0ODAw.CyjPWg.tphzYLLyzkQyP9Y3QPb0oPFbZTA'
  19.  
  20. jokes = [
  21. "What’s the difference between a joke and two dicks?\n\nYou can’t take a joke.",
  22. "What’s the difference between Hitler and Michael Phelps?\n\nPhelps can finish a race.",
  23. "What’s the difference between an onion and a hooker?\n\nI cry when I’m cutting up the onion.",
  24. "What do Jewish pedophiles say?\n\n“Hey kid, want to buy some candy?”",
  25. "What’s the difference between a Catholic priest and acne?\n\nAcne doesn’t come on a boys face until he’s 13.",
  26. "So I was balls deep in this guy thrusting as hard as I could when I reached around to give him a hand job. Guess what? That fucker had an erection. What. Queer.",
  27. "The worst part about being a pedophile is trying to fit in.",
  28. "What does a baby look like after a minute in the microwave?\n\nI don’t know, I close my eyes when I masturbate.",
  29. "What’s so good about an Ethiopian blow job?\n\nYou just KNOW she’ll swallow.",
  30. "I lost my virginity to a retarded girl last night.\n\nI wanted my first time to be special.",
  31. "Your life.",
  32. "What's the difference between Paul Walker and a computer?\n\nI give a fuck when my computer crashes.",
  33. 'My Grandpa said, "Your generation relies too much on technology!" I replied, "No, your generation relies too much on technology!" Then I unplugged his life support.',
  34. "What do you call a five year old with no friends?\n\nA sandy hook survivor.",
  35. "Jesus Christ fed 2,000 people with 5 loaves of bread and 2 fish, but Adolf Hitler made 6 million Jews toast.",
  36. "What's the worst thing about breaking up with a Japanese girl?\n\nYou have to drop the bomb twice before she gets the message.",
  37. "How do Ethiopians celebrate their kids first birthday?\n\nBy putting flowers on the grave.",
  38. "Feminism",
  39. "Most black 15 year-olds in this country are decent, law abiding citizens.\n\nIt's their kids who cause all the trouble.",
  40. "What is a pedophiles favorite part about Halloween?\n\nFree delivery.",
  41. "So I painted my laptop black, hoping it would run faster…\n\nNow it doesn't work.",
  42. "How do you kill a redneck?\n\nWait 'till he fucks his sister then cut the brakes on his house.",
  43. "How do you fit 4 queers on a barstool?\n\nFlip it upside-down.",
  44. "How do you get your baby out of the blender?\n\nTortilla chips.",
  45. "How do you get a black guy out of a tree?\n\nYou cut the noose.",
  46. ]
  47.  
  48. meme_files = [
  49. "CIRCLES.png",
  50. "connorNUT.png",
  51. "denk.png",
  52. "fat.png",
  53. "fuckingSteam.png",
  54. "fuckminions.png",
  55. "furfag dog.png",
  56. "GRAPHMEME.png",
  57. "headRubbins.png",
  58. "hitler.png",
  59. "jesuspls.png",
  60. "joke.png",
  61. "NOG NOG.png",
  62. "noodlepoodle.png",
  63. "rip.png",
  64. "ripip.png",
  65. "RIPIPIPIPIP.png",
  66. "ROBLOXSEX.png",
  67. "ROTTEN.meme.png",
  68. "scarce.png",
  69. "turkish.png",
  70. "Untitled.png",
  71. "YES.png",
  72. "R0meme.png",
  73. "R0meme1.png",
  74. "R0meme2.png",
  75. "R0meme3.png",
  76. "R0meme4.png",
  77. "R0meme5.png",
  78. "R0meme7.png",
  79. ]
  80.  
  81. eight_balls = [
  82. "It is certain", # affirmatives
  83. "It is decidedly so",
  84. "Without a doubt",
  85. "Yes, definetly",
  86. "You may rely on it",
  87. "As I see it, yes",
  88. "Most likely",
  89. "Outlook good",
  90. "Yes",
  91. "Signs point to yes",
  92. "Reply hazy, try again", # non-commitals
  93. "Ask again later",
  94. "Better not tell you now",
  95. "Cannot predict now",
  96. "Concentrate and ask again",
  97. "Don't count on it", # negatives
  98. "My reply is no",
  99. "My sources say no",
  100. "Outlook is not so good",
  101. "Very doubtful",
  102. ]
  103.  
  104. quiz_canswers = {
  105. "GRAPHMEME.png":"Stock Photo Meme",
  106. "CIRCLES.png":"Inside Joke",
  107. }
  108.  
  109. commands = [
  110. "-joke",
  111. "-meme",
  112. "-8ball",
  113. "-roll",
  114. "-users",
  115. "-heartdisease",
  116. "-find *",
  117. "-find [filename]",
  118. "-help",
  119. "and there are more, but they are not commands. you have to find them yourself.",
  120. ]
  121.  
  122. ADMINS = [
  123. "Park#2586",
  124. ]
  125.  
  126. PHRASE_BYPASS = [
  127. "KeemBot#4023",
  128. "ParkBot#5090",
  129. ]
  130.  
  131. HELP_STRING = "sup d00d.\nhere are all of the commands. although I can't tell u wat they do."
  132.  
  133. for cmd in commands:
  134. HELP_STRING += "\n" + cmd
  135.  
  136. max_roll = 100
  137.  
  138. def check_startwith(msg, txt):
  139. l = len(txt)
  140. if msg[:l] == txt:
  141. return True
  142. else:
  143. return False
  144.  
  145. def cmd_test(author, message):
  146. client.send_message("Test to you too, bub!")
  147.  
  148. async def find_user(u, msg, client):
  149. c = 0
  150. for member in msg.server.members:
  151. if u in str(member):
  152. c += 1
  153. user = member;
  154. if c == 1:
  155. return user
  156. elif c > 1:
  157. await client.send_message(msg.channel, "Too many users found with '{}' in their name.\nBe more specific?".format(u))
  158. elif c == 0:
  159. await client.send_message(msg.channel, "No user found with '{}' in their name.".format(u))
  160.  
  161. @client.event
  162. async def on_message(msg):
  163. author = msg.author
  164. print("From Server '{}' on Channel #{}:\n\t[{}] {}: {}\n".format(msg.server, msg.channel, msg.timestamp, msg.author, msg.content))
  165. if check_startwith(msg.content, "-test"):
  166. ## em = discord.Embed(title='My Embed Title', description='My Embed Content.', colour=0xDEADBF)
  167. ## em.set_author(name='Someone', icon_url=client.user.default_avatar_url)
  168. ## await client.send_message(msg.channel, embed=em)
  169. await client.send_typing(msg.channel)
  170. elif check_startwith(msg.content, "-joke"):
  171. joke = jokes[randrange(len(jokes))]
  172. await client.send_message(msg.channel, joke)
  173. elif check_startwith(msg.content, "-8ball"):
  174. ans = eight_balls[randrange(len(eight_balls))]
  175. await client.send_message(msg.channel, ans)
  176. elif check_startwith(msg.content, "-meme"):
  177. meme = meme_files[randrange(len(meme_files))]
  178. await client.send_message(msg.channel, meme)
  179. await client.send_file(msg.channel, meme)
  180. elif check_startwith(msg.content, "-roll"):
  181. roll = randrange(max_roll)
  182. await client.send_message(msg.channel, "Rolled {} out of {}.".format(roll, max_roll))
  183. elif check_startwith(msg.content, "-users"):
  184. users = ""
  185. await client.send_message(msg.channel, "These are all of the users that I can see:")
  186. for member in msg.server.members:
  187. member = str(member)
  188. users += member + "\n"
  189. await client.send_message(msg.channel, users)
  190. elif "parkbot" in msg.content.lower():
  191. if not str(msg.author) in PHRASE_BYPASS:
  192. await client.send_message(msg.channel, "Excuse me?")
  193. ## elif "noah" in msg.content.lower() or "rutuu" in msg.content.lower():
  194. ## await client.send_file(msg.channel, "heartattack.jpg")
  195. ## await client.send_message(msg.channel, "I saw his name and I got cancer.")
  196. elif check_startwith(msg.content, "-heartdisease"):
  197. await client.send_file(msg.channel, "heartattack.jpg")
  198. elif "nig" in msg.content.lower():
  199. if not str(msg.author) in PHRASE_BYPASS:
  200. i = msg.content.lower().index("nig")
  201. if msg.content[i:i+5] != "night":
  202. await client.send_file(msg.channel, "NIGGERED.jpg")
  203. elif check_startwith(msg.content, "-find *"):
  204. files = ""
  205. for file in meme_files:
  206. files += file + "\n"
  207. await client.send_message(msg.channel, "All files on disk:\n" + files)
  208. elif check_startwith(msg.content, "-find"):
  209. search = msg.content.split(" ")
  210. tmf = ""
  211. q = search[1].lower()
  212. c = 0
  213. f = ""
  214. for file in meme_files:
  215. if q in file.lower():
  216. c += 1
  217. f = file
  218. tmf += file + "\n"
  219. FILE = file
  220. if c == 0:
  221. await client.send_message(msg.channel, "No files on disk found.")
  222. elif c == 1:
  223. await client.send_file(msg.channel, FILE)
  224. elif c > 1:
  225. await client.send_message(msg.channel, "More than one file found.\n" + tmf)
  226. elif check_startwith(msg.content, "-quiz"):
  227. await client.send_message(msg.author, "looks like u want 2 play the meem quiz.")
  228. elif check_startwith(msg.content, "-help"):
  229. await client.send_message(msg.author, HELP_STRING)
  230. await client.send_message(msg.channel, "I have sent some help through our PM's!")
  231. elif check_startwith(msg.content, "-send"):
  232. i hate black people
  233. elif check_startwith(msg.content, "-cmd"):
  234. if str(msg.author) in ADMINS:
  235. command = msg.content.split(' ')[1]
  236. if command == "add_admin":
  237. user = msg.content.split(' ')[2]
  238. for member in msg.server.members:
  239. if user in str(member):
  240. if not str(member) in ADMINS:
  241. # add username to admin list
  242. ADMINS.append(str(member))
  243. print("Admin added")
  244. print(ADMINS)
  245. await client.send_message(msg.channel, "User {} added to temporary admin list.\nThese admins go away when I restart.".format(member))
  246. break
  247. else:
  248. await client.send_message(msg.channel, "This user is already a temporary admin.")
  249. elif command == "un_admin":
  250. user = msg.content.split(' ')[2]
  251. for member in msg.server.members:
  252. if user in str(member):
  253. if str(member) in ADMINS:
  254. # add username to admin list
  255. index = ADMINS.index(str(member))
  256. del ADMINS[index]
  257. print("Admin added")
  258. print(ADMINS)
  259. await client.send_message(msg.channel, "User {} removed from the temporary admin list.\nThese admins go away when I restart.".format(member))
  260. break
  261. else:
  262. await client.send_message(msg.channel, "I can't remove that person, as they are not in the admins list.\nHave I restarted recently?")
  263. break
  264. elif command == "ban":
  265. u = msg.content.split(' ')[2]
  266. user = await find_user(u, msg, client)
  267. client.ban(user)
  268.  
  269. ## elif str(msg.author) == "Rutuu99#1310":
  270. ## await client.send_message(msg.channel, "Make it stop!")
  271.  
  272. ## elif check_startwith(msg.content, "-join"):
  273. ## print("JOIN")
  274. ## words = msg.content.split('discord.gg/')
  275. ## print(words[1])
  276. ## client.accept_invite(words[1])
  277.  
  278. ## meme = meme_files[randrange(len(meme_files))]
  279. ## await client.send_file(msg.channel, meme)
  280.  
  281. client.change_presence()
  282. client.login(token)
  283. # client.accept_invite('https://discord.gg/DgTqNj5')
  284. client.run(token)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement