Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import logging
- import asyncio
- import urllib.request
- import sys
- from random import random, randrange
- logger = logging.getLogger('discord')
- logger.setLevel(logging.DEBUG)
- handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
- handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s:%(message)s'))
- logger.addHandler(handler)
- client = discord.Client()
- token = 'MjU0ODI5NjQzNTY2Mjg0ODAw.CyjPWg.tphzYLLyzkQyP9Y3QPb0oPFbZTA'
- jokes = [
- "What’s the difference between a joke and two dicks?\n\nYou can’t take a joke.",
- "What’s the difference between Hitler and Michael Phelps?\n\nPhelps can finish a race.",
- "What’s the difference between an onion and a hooker?\n\nI cry when I’m cutting up the onion.",
- "What do Jewish pedophiles say?\n\n“Hey kid, want to buy some candy?”",
- "What’s the difference between a Catholic priest and acne?\n\nAcne doesn’t come on a boys face until he’s 13.",
- "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.",
- "The worst part about being a pedophile is trying to fit in.",
- "What does a baby look like after a minute in the microwave?\n\nI don’t know, I close my eyes when I masturbate.",
- "What’s so good about an Ethiopian blow job?\n\nYou just KNOW she’ll swallow.",
- "I lost my virginity to a retarded girl last night.\n\nI wanted my first time to be special.",
- "Your life.",
- "What's the difference between Paul Walker and a computer?\n\nI give a fuck when my computer crashes.",
- '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.',
- "What do you call a five year old with no friends?\n\nA sandy hook survivor.",
- "Jesus Christ fed 2,000 people with 5 loaves of bread and 2 fish, but Adolf Hitler made 6 million Jews toast.",
- "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.",
- "How do Ethiopians celebrate their kids first birthday?\n\nBy putting flowers on the grave.",
- "Feminism",
- "Most black 15 year-olds in this country are decent, law abiding citizens.\n\nIt's their kids who cause all the trouble.",
- "What is a pedophiles favorite part about Halloween?\n\nFree delivery.",
- "So I painted my laptop black, hoping it would run faster…\n\nNow it doesn't work.",
- "How do you kill a redneck?\n\nWait 'till he fucks his sister then cut the brakes on his house.",
- "How do you fit 4 queers on a barstool?\n\nFlip it upside-down.",
- "How do you get your baby out of the blender?\n\nTortilla chips.",
- "How do you get a black guy out of a tree?\n\nYou cut the noose.",
- ]
- meme_files = [
- "CIRCLES.png",
- "connorNUT.png",
- "denk.png",
- "fat.png",
- "fuckingSteam.png",
- "fuckminions.png",
- "furfag dog.png",
- "GRAPHMEME.png",
- "headRubbins.png",
- "hitler.png",
- "jesuspls.png",
- "joke.png",
- "NOG NOG.png",
- "noodlepoodle.png",
- "rip.png",
- "ripip.png",
- "RIPIPIPIPIP.png",
- "ROBLOXSEX.png",
- "ROTTEN.meme.png",
- "scarce.png",
- "turkish.png",
- "Untitled.png",
- "YES.png",
- "R0meme.png",
- "R0meme1.png",
- "R0meme2.png",
- "R0meme3.png",
- "R0meme4.png",
- "R0meme5.png",
- "R0meme7.png",
- ]
- eight_balls = [
- "It is certain", # affirmatives
- "It is decidedly so",
- "Without a doubt",
- "Yes, definetly",
- "You may rely on it",
- "As I see it, yes",
- "Most likely",
- "Outlook good",
- "Yes",
- "Signs point to yes",
- "Reply hazy, try again", # non-commitals
- "Ask again later",
- "Better not tell you now",
- "Cannot predict now",
- "Concentrate and ask again",
- "Don't count on it", # negatives
- "My reply is no",
- "My sources say no",
- "Outlook is not so good",
- "Very doubtful",
- ]
- quiz_canswers = {
- "GRAPHMEME.png":"Stock Photo Meme",
- "CIRCLES.png":"Inside Joke",
- }
- commands = [
- "-joke",
- "-meme",
- "-8ball",
- "-roll",
- "-users",
- "-heartdisease",
- "-find *",
- "-find [filename]",
- "-help",
- "and there are more, but they are not commands. you have to find them yourself.",
- ]
- ADMINS = [
- "Park#2586",
- ]
- PHRASE_BYPASS = [
- "KeemBot#4023",
- "ParkBot#5090",
- ]
- HELP_STRING = "sup d00d.\nhere are all of the commands. although I can't tell u wat they do."
- for cmd in commands:
- HELP_STRING += "\n" + cmd
- max_roll = 100
- def check_startwith(msg, txt):
- l = len(txt)
- if msg[:l] == txt:
- return True
- else:
- return False
- def cmd_test(author, message):
- client.send_message("Test to you too, bub!")
- async def find_user(u, msg, client):
- c = 0
- for member in msg.server.members:
- if u in str(member):
- c += 1
- user = member;
- if c == 1:
- return user
- elif c > 1:
- await client.send_message(msg.channel, "Too many users found with '{}' in their name.\nBe more specific?".format(u))
- elif c == 0:
- await client.send_message(msg.channel, "No user found with '{}' in their name.".format(u))
- @client.event
- async def on_message(msg):
- author = msg.author
- print("From Server '{}' on Channel #{}:\n\t[{}] {}: {}\n".format(msg.server, msg.channel, msg.timestamp, msg.author, msg.content))
- if check_startwith(msg.content, "-test"):
- ## em = discord.Embed(title='My Embed Title', description='My Embed Content.', colour=0xDEADBF)
- ## em.set_author(name='Someone', icon_url=client.user.default_avatar_url)
- ## await client.send_message(msg.channel, embed=em)
- await client.send_typing(msg.channel)
- elif check_startwith(msg.content, "-joke"):
- joke = jokes[randrange(len(jokes))]
- await client.send_message(msg.channel, joke)
- elif check_startwith(msg.content, "-8ball"):
- ans = eight_balls[randrange(len(eight_balls))]
- await client.send_message(msg.channel, ans)
- elif check_startwith(msg.content, "-meme"):
- meme = meme_files[randrange(len(meme_files))]
- await client.send_message(msg.channel, meme)
- await client.send_file(msg.channel, meme)
- elif check_startwith(msg.content, "-roll"):
- roll = randrange(max_roll)
- await client.send_message(msg.channel, "Rolled {} out of {}.".format(roll, max_roll))
- elif check_startwith(msg.content, "-users"):
- users = ""
- await client.send_message(msg.channel, "These are all of the users that I can see:")
- for member in msg.server.members:
- member = str(member)
- users += member + "\n"
- await client.send_message(msg.channel, users)
- elif "parkbot" in msg.content.lower():
- if not str(msg.author) in PHRASE_BYPASS:
- await client.send_message(msg.channel, "Excuse me?")
- ## elif "noah" in msg.content.lower() or "rutuu" in msg.content.lower():
- ## await client.send_file(msg.channel, "heartattack.jpg")
- ## await client.send_message(msg.channel, "I saw his name and I got cancer.")
- elif check_startwith(msg.content, "-heartdisease"):
- await client.send_file(msg.channel, "heartattack.jpg")
- elif "nig" in msg.content.lower():
- if not str(msg.author) in PHRASE_BYPASS:
- i = msg.content.lower().index("nig")
- if msg.content[i:i+5] != "night":
- await client.send_file(msg.channel, "NIGGERED.jpg")
- elif check_startwith(msg.content, "-find *"):
- files = ""
- for file in meme_files:
- files += file + "\n"
- await client.send_message(msg.channel, "All files on disk:\n" + files)
- elif check_startwith(msg.content, "-find"):
- search = msg.content.split(" ")
- tmf = ""
- q = search[1].lower()
- c = 0
- f = ""
- for file in meme_files:
- if q in file.lower():
- c += 1
- f = file
- tmf += file + "\n"
- FILE = file
- if c == 0:
- await client.send_message(msg.channel, "No files on disk found.")
- elif c == 1:
- await client.send_file(msg.channel, FILE)
- elif c > 1:
- await client.send_message(msg.channel, "More than one file found.\n" + tmf)
- elif check_startwith(msg.content, "-quiz"):
- await client.send_message(msg.author, "looks like u want 2 play the meem quiz.")
- elif check_startwith(msg.content, "-help"):
- await client.send_message(msg.author, HELP_STRING)
- await client.send_message(msg.channel, "I have sent some help through our PM's!")
- elif check_startwith(msg.content, "-send"):
- i hate black people
- elif check_startwith(msg.content, "-cmd"):
- if str(msg.author) in ADMINS:
- command = msg.content.split(' ')[1]
- if command == "add_admin":
- user = msg.content.split(' ')[2]
- for member in msg.server.members:
- if user in str(member):
- if not str(member) in ADMINS:
- # add username to admin list
- ADMINS.append(str(member))
- print("Admin added")
- print(ADMINS)
- await client.send_message(msg.channel, "User {} added to temporary admin list.\nThese admins go away when I restart.".format(member))
- break
- else:
- await client.send_message(msg.channel, "This user is already a temporary admin.")
- elif command == "un_admin":
- user = msg.content.split(' ')[2]
- for member in msg.server.members:
- if user in str(member):
- if str(member) in ADMINS:
- # add username to admin list
- index = ADMINS.index(str(member))
- del ADMINS[index]
- print("Admin added")
- print(ADMINS)
- await client.send_message(msg.channel, "User {} removed from the temporary admin list.\nThese admins go away when I restart.".format(member))
- break
- else:
- await client.send_message(msg.channel, "I can't remove that person, as they are not in the admins list.\nHave I restarted recently?")
- break
- elif command == "ban":
- u = msg.content.split(' ')[2]
- user = await find_user(u, msg, client)
- client.ban(user)
- ## elif str(msg.author) == "Rutuu99#1310":
- ## await client.send_message(msg.channel, "Make it stop!")
- ## elif check_startwith(msg.content, "-join"):
- ## print("JOIN")
- ## words = msg.content.split('discord.gg/')
- ## print(words[1])
- ## client.accept_invite(words[1])
- ## meme = meme_files[randrange(len(meme_files))]
- ## await client.send_file(msg.channel, meme)
- client.change_presence()
- client.login(token)
- # client.accept_invite('https://discord.gg/DgTqNj5')
- client.run(token)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement