Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
4,891
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.59 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3. from discord.ext.commands.cooldowns import BucketType
  4. import youtube_dl
  5. import json
  6. import os
  7. import asyncio
  8. import random
  9. from random import randint
  10. import time
  11. import requests
  12. import urllib.parse, urllib.request, re
  13. import smtplib
  14.  
  15. client = commands.Bot(command_prefix="!")
  16. client.remove_command('help')
  17. member = discord.Member
  18.  
  19. @client.event
  20. async def on_ready():
  21. print("Logged in as:")
  22. print(client.user.name)
  23. print("!")
  24. print(client.user.id)
  25. print(discord.__version__)
  26. print("Current servers:")
  27. for guild in client.guilds:
  28. print(guild.name)
  29. game = discord.Game("on daedricmc.net")
  30. await client.change_presence(status=discord.Status.idle, activity=game)
  31.  
  32. @client.command(pass_context=True)
  33. async def help(ctx):
  34. embed = discord.Embed(colour= discord.Colour.green()
  35.  
  36. )
  37.  
  38. embed.set_author(name="Commands List For Server: ChillAlts\n")
  39. embed.set_footer(text="Enjoy Your Stay!")
  40. embed.add_field(name='`Member Commands:`', value='Commands available to members and above.', inline =False)
  41. embed.add_field(name=f'!help', value='Sends this message.\n **Usage: !help**', inline =False)
  42. embed.add_field(name=f'!mc', value='Sends you 1x Minecraft account. Please use this command in #mc under the generators tab.\n **Usage: !mc | Delay: 10 Minutes**', inline =False)
  43. embed.add_field(name=f'spotify', value='Sends you 1x Spotify account. Please use this command in #spotify under the generators tab.\n **Usage: !spotify | Delay: 10 Minutes**', inline =False)
  44. embed.add_field(name=f' !userinfo', value="Sends you a user's info. This command tells you the following: User ID, Name & Discriminator, The date of account creation, The date when they joined the server, The roles that they inherit, Their top role, and States if they are a bot or not.\n **Usage: !userinfo (member)**", inline =False)
  45. embed.add_field(name=f' !ping', value='Checks how fast our servers are running. Sends back the roundtrip time in **ms**.\n**Usage: !ping** \n', inline =False)
  46. embed.add_field(name=f' !bitcoin', value='Displays the current price of one bitcoin.\n**Usage: !bitcoin**', inline=False)
  47. embed.add_field(name=f' !8ball', value='Ask the 8 ball a question and it responds truthfully, not randomly\n**Usage: !8ball (question)**', inline=False)
  48. embed.add_field(name=f' !add', value='Adds two numbers to each other.\n**Usage: !add (num1 num2)**', inline=False)
  49. embed.add_field(name=f' !subtract', value='Subtracts two numbers from each other.\n**Usage: !subtract (num1 num2)**', inline=False)
  50. embed.add_field(name=f' !multiply', value='Multiplies two numbers to each other.\n**Usage: !multiply (num1 num2)**', inline=False)
  51. embed.add_field(name=f' !divide', value='Divides two numbers from each other.\n**Usage: !divide (num1 num2)**', inline=False)
  52. embed.add_field(name='`Staff Commands:`', value='Commands available to only staff members.', inline =False)
  53. embed.add_field(name=f' !kick', value='Kicks the specified member for the specified reasoning.\n**Usage: !kick (member) (reason)**', inline =False)
  54. embed.add_field(name=f' !ban', value='Bans the specified member for the specified reasoning.\n**Usage: !ban (member) (reason)**', inline =False)
  55. embed.add_field(name=f' !clearchannel', value='Clears the channel of all its messages of the channel it was run in.\n**Usage: !clearchannel**', inline=False)
  56. embed.add_field(name=f' !logout', value='Logs out & closes the bot.\n**Usage: !logout**', inline=False)
  57. await ctx.send(embed = embed)
  58.  
  59. @client.command()
  60. @commands.has_role("MC Gen Access")
  61. @commands.cooldown(1,600,BucketType.default)
  62. async def mc(ctx):
  63. userID = ctx.author.name
  64. combos_name = ('mc.txt')
  65. combos = open(combos_name, "r").readlines()
  66. combo = random.choice(combos)
  67. if ctx.channel.name == "mc":
  68. await ctx.channel.send(f":white_check_mark: ``%s``, You Have Been Sent x1 Minecraft Accounts" % (userID))
  69. embed = discord.Embed(title = "Here is your `Minecraft` Account:", description = combo, Colour = discord.Colour.red(), timestamp=ctx.message.created_at)
  70. embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
  71. await ctx.author.send(embed = embed)
  72. print(f"{ctx.message.author} requested 1x Minecraft account. Returned with account, {combo}")
  73. await asyncio.sleep(5)
  74. await ctx.channel.purge()
  75. else:
  76. await ctx.send("Please run this command in the right channel! #mc", delete_after=5)
  77. @mc.error
  78. async def mc_error(ctx, error):
  79. if isinstance(error, commands.CommandOnCooldown):
  80. if error.retry_after >= 60:
  81. time = error.retry_after/60
  82. await ctx.author.send(f"*You're On Cooldown!* The cooldown for this command is 10 minutes! Try again in {int(time)} minutes!")
  83. await ctx.send("**Error: Cooldown** | Check your dms.")
  84. await asyncio.sleep(5)
  85. await ctx.channel.purge()
  86. return
  87. await ctx.author.send(f"*You're On Cooldown!* The cooldown for this command is 10 minutes! Try again in {int(error.retry_after)} seconds!")
  88. await ctx.send("**Error: Cooldown** | Check your dms.")
  89. await asyncio.sleep(5)
  90. await ctx.channel.purge()
  91.  
  92. @client.command()
  93. @commands.has_role("Spotify Gen Access")
  94. @commands.cooldown(1,600,BucketType.channel)
  95. async def spotify(ctx):
  96. userID = ctx.author.name
  97. combos_name = ('spotify.txt')
  98. combos = open(combos_name, "r").readlines()
  99. combo = random.choice(combos)
  100. if ctx.channel.name == "spotify":
  101. await ctx.channel.send(":white_check_mark: ``%s``, You Have Been Sent x1 Spotify Accounts" % (userID))
  102. embed = discord.Embed(title = "Here is your `Spotify` Account:", description = combo, Colour = discord.Colour.green(), timestamp=ctx.message.created_at)
  103. embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
  104. await ctx.author.send(embed = embed)
  105. print(f"{ctx.message.author} requested 1x Spotify account. Returned with account, {combo}")
  106. await asyncio.sleep(5)
  107. await ctx.channel.purge()
  108. else:
  109. await ctx.send("Please run this command in the right channel! #spotify", delete_after=5)
  110.  
  111. @spotify.error
  112. async def spotify_error(ctx, error):
  113. if isinstance(error, commands.CommandOnCooldown):
  114. if error.retry_after >= 60:
  115. time = error.retry_after/60
  116. await ctx.author.send(f"*You're On Cooldown!* The cooldown for this command is 10 minutes! Try again in {int(time)} minutes!")
  117. await ctx.send("**Error: Cooldown** | Check your dms.")
  118. await asyncio.sleep(5)
  119. await ctx.channel.purge()
  120. return
  121. await ctx.author.send(f"*You're On Cooldown!* The cooldown for this command is 10 minutes! Try again in {int(error.retry_after)} seconds!")
  122. await ctx.send("**Error: Cooldown** | Check your dms.")
  123. await asyncio.sleep(5)
  124. await ctx.channel.purge()
  125.  
  126. @client.command()
  127. async def userinfo(ctx, member: discord.Member= None):
  128. if member == None:
  129. await ctx.send("Please specify a member for me to send info on.")
  130. return
  131. roles = [role for role in member.roles]
  132. embed = discord.Embed(colour=member.color, timestamp=ctx.message.created_at)
  133. embed.set_author(name=f"User Info - {member}")
  134. embed.set_thumbnail(url=member.avatar_url)
  135. embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
  136. embed.add_field(name="ID:", value=member.id, inline=True)
  137. embed.add_field(name="UserName:", value=(member.display_name + '#' + member.discriminator), inline=True)
  138. embed.add_field(name="Created at:", value=member.created_at.strftime("%a, %#d %B %Y, %I:%M %p "), inline=True)
  139. embed.add_field(name="Joined at:", value=member.joined_at, inline=True)
  140. embed.add_field(name=f"Roles ({len(roles)})", value=" ".join([role.mention for role in roles]), inline=True)
  141. embed.add_field(name="Top role:", value=member.top_role.mention, inline=True)
  142. embed.add_field(name="Bot?", value=member.bot, inline=True)
  143. await ctx.send(embed=embed)
  144.  
  145. @client.command()
  146. async def ping(ctx):
  147. embed = discord.Embed(colour=ctx.author.color, timestamp=ctx.message.created_at)
  148. embed.set_author(name=f"Roundtrip took {round(client.latency * 1000)}ms")
  149. embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
  150. await ctx.send(embed=embed)
  151.  
  152. @client.command(aliases=['8ball'])
  153. async def _8ball(ctx, *, question = None):
  154. if question == None:
  155. await ctx.send("Please send a question for the 8 ball to answer.")
  156. return
  157. if not "?" in question:
  158. await ctx.send("This does not look like a question. Please retry with a '?' after your question.")
  159. return
  160. responses = [':8ball: It is certain.',
  161. ':8ball: It is decidely so.',
  162. ':8ball: Without a doubt.',
  163. ':8ball: Yes - definitely.',
  164. ':8ball: As I see it, yes.',
  165. ':8ball: Most likely.',
  166. ':8ball: You may rely on it.',
  167. ':8ball: Yes.',
  168. ':8ball: Signs point to yes.',
  169. ':8ball: Outlook good.',
  170. ':8ball: Reply hazy, try again.',
  171. ':8ball: Ask again later.',
  172. ':8ball: Better not tell you now.',
  173. ':8ball: Cannont predict now.',
  174. ':8ball: Concentrate and ask again.',
  175. ':8ball: Dont count on it',
  176. ':8ball: My reply is no.',
  177. ':8ball: My sources say no.',
  178. ':8ball: Outlook not so good.',
  179. ':8ball: Very doubtful.']
  180. await ctx.channel.send(f'{random.choice(responses)}')
  181.  
  182. @client.command()
  183. async def bitcoin(ctx):
  184. url = 'https://api.coindesk.com/v1/bpi/currentprice/BTC.json'
  185. response = requests.get(url)
  186. value = response.json()['bpi']['USD']['rate']
  187. await ctx.send("Bitcoin price is: $" + value)
  188.  
  189. @client.command(pass_context = True)
  190. @commands.has_role("Admin")
  191. async def kick(ctx, member: discord.Member = None, *, reason = None):
  192. if reason == None:
  193. reason = "not specified."
  194. if member == None:
  195. await ctx.send("Please specify a member to Kick.")
  196. await member.kick(reason=reason)
  197. await ctx.channel.send(f":boot: {member.mention} was kicked for reason: " + (reason))
  198.  
  199. @client.command()
  200. @commands.has_role("Admin")
  201. async def ban(ctx, member: discord.Member = None, *, reason = None):
  202. if reason == None:
  203. reason = "not specified."
  204. if member == None:
  205. await ctx.send("Please specify a member to Ban.")
  206. await member.ban(reason=reason)
  207. await ctx.channel.send(f":boot: {member.mention} was banned for reason: "+ (reason))
  208.  
  209. @client.command()
  210. @commands.has_role("Admin")
  211. async def clearchannel(ctx):
  212. message = "Channel cleared."
  213. await ctx.channel.purge()
  214. await ctx.channel.send(message)
  215. await asyncio.sleep(1)
  216. await ctx.channel.purge()
  217.  
  218. @client.event
  219. async def on_member_join(ctx):
  220. embed = discord.Embed(colour= discord.Colour.green()
  221.  
  222. )
  223.  
  224. embed.set_author(name="Welcome To Chill Alts! We hope you enjoy your stay.\nHere are the commands in our server:\n")
  225. embed.set_footer(text="Enjoy Your Stay!")
  226. embed.add_field(name='`Member Commands:`', value='Commands available to members and above.', inline =False)
  227. embed.add_field(name=' !help', value='Sends this message.\n **Usage: !help**', inline =False)
  228. embed.add_field(name=' !mc', value='Sends you 1x Minecraft account. Please use this command in #mc under the generators tab. Failing to follow this will result in warnings which will lead to a kick.\n **Usage: !mc**', inline =False)
  229. embed.add_field(name=' !spotify', value='Sends you 1x Spotify account. Please use this command in #spotify under the generators tab. Failing to follow this will result in warnings which will lead to a kick.\n **Usage: !spotify**', inline =False)
  230. embed.add_field(name=' !userinfo', value="Sends you a user's info. This command tells you the following: User ID, Name & Discriminator, The date of account creation, The date when they joined the server, The roles that they inherit, Their top role, and States if they are a bot or not.\n **Usage: !userinfo (member)**", inline =False)
  231. embed.add_field(name=' !ping', value='Checks how fast our servers are running. Sends back the roundtrip time in **ms**.\n**Usage: !ping** \n', inline =False)
  232. embed.add_field(name=' !bitcoin', value='Displays the current price of one bitcoin.\n**Usage: !bitcoin**', inline=False)
  233. embed.add_field(name=' !8ball', value='Ask the 8 ball a question and it responds truthfully, not randomly\n**Usage: !8ball (question)**', inline=False)
  234. embed.add_field(name='`Staff Commands:`', value='Commands available to only staff members.', inline =False)
  235. embed.add_field(name=' !kick', value='Kicks the specified member for the specified reasoning.\n**Usage: !kick (member) (reason)**', inline =False)
  236. embed.add_field(name=' !ban', value='Bans the specified member for the specified reasoning.\n**Usage: !ban (member) (reason)**', inline =False)
  237. embed.add_field(name=' !clearchannel', value='Clears the channel of all its messages of the channel it was run in.\n**Usage: !clearchannel**', inline=False)
  238. embed.add_field(name=' !clear', value='Clears the specified number of messages in the channel that it was run in.\n**Usage: !clear (amount)**', inline=False)
  239. embed.add_field(name=' !logout', value='Logs the bot out of its client.\n**Usage: !logout**', inline=False)
  240. await ctx.send(embed = embed)
  241.  
  242. @client.command()
  243. @commands.has_role("Admin")
  244. async def stock(ctx, pass_context=True, member = discord.Member):
  245. mcaccs = 0
  246. spotifyaccs = 0
  247. f = open("C:/Users/Karter/Desktop/Python/ChillAlts/spotify.txt", "r")
  248. g = open("C:/Users/Karter/Desktop/Python/ChillAlts/mc.txt", "r")
  249. for mcaccs, line in enumerate(g):
  250. pass
  251. for spotifyaccs, line in enumerate(f):
  252. pass
  253. embed = discord.Embed(colour= discord.Colour.teal(), timestamp=ctx.message.created_at)
  254. embed.set_author(name="Current Stock:\n")
  255. embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
  256. embed.add_field(name="Minecraft:", value=(mcaccs +1), inline =True)
  257. embed.add_field(name="Spotify:", value=(spotifyaccs +1), inline= True)
  258. await ctx.channel.send(embed = embed)
  259. f.close()
  260.  
  261. @client.command()
  262. @commands.has_role("Admin")
  263. async def clear(ctx, amount: int = None):
  264. if amount == None:
  265. await ctx.send("Please specify an amount to clear.")
  266. await ctx.channel.purge(limit=amount + 1)
  267. embed = discord.Embed(colour=ctx.author.color, timestamp=ctx.message.created_at)
  268. embed.set_author(name=f"{amount} messages got deleted.")
  269. embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
  270. await ctx.send(embed=embed)
  271.  
  272. @client.command()
  273. @commands.has_role("Admin")
  274. async def logout(ctx):
  275. await ctx.channel.send("Logging Out! :wave:")
  276. await client.close()
  277.  
  278. @client.command()
  279. async def load(ctx, Accounts):
  280.  
  281. appendFile = open('mc.txt', 'a')
  282. appendFile.write(Accounts)
  283. appendFile.close()
  284.  
  285. @client.command(pass_context=True)
  286. async def embed(ctx, *args):
  287. uMessage = ''
  288. for word in args:
  289. uMessage += word
  290. uMessage += ' '
  291. user = ctx.message.author.name
  292. embed = discord.Embed(title = user, description = uMessage, Colour = discord.Colour.red(), timestamp=ctx.message.created_at)
  293. embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
  294. await ctx.channel.send(embed = embed)
  295.  
  296. @client.command()
  297. @commands.has_role("Admin")
  298. async def mute(ctx, member: discord.Member=None):
  299. role = discord.utils.get(ctx.guild.roles, name="Muted")
  300. await member.add_roles(role)
  301. await ctx.channel.send("Player Muted.")
  302.  
  303. @client.command()
  304. @commands.has_role("Admin")
  305. async def unmute(ctx, member: discord.Member=None):
  306. role = discord.utils.get(ctx.guild.roles, name="Muted")
  307. await member.remove_roles(role)
  308. await ctx.channel.send("Player Unmuted.")
  309.  
  310. @client.command()
  311. async def coinflip(ctx):
  312. choices = ["Heads", "Tails"]
  313. rancoin = random.choice(choices)
  314. await ctx.channel.send(rancoin)
  315.  
  316. @client.command(aliases=["m"])
  317. async def multiply(ctx, num1: int, num2: int):
  318. await ctx.send(num1*num2)
  319.  
  320. @client.command(aliases=["a"])
  321. async def add(ctx, num1: int, num2: int):
  322. await ctx.channel.send(num1+num2)
  323. @client.command(aliases=["s"])
  324. async def subtract(ctx, num1: int, num2: int):
  325. await ctx.send(num1-num2)
  326.  
  327. @client.command(aliases=["d"])
  328. async def divide(ctx, num1: int, num2: int):
  329. await ctx.send(num1/num2)
  330.  
  331. @client.command()
  332. async def say(ctx, *, word):
  333. await ctx.send(word)
  334.  
  335. @client.command()
  336. async def l(ctx, Accounts):
  337. appendFile = open('mc.txt', 'a')
  338. appendFile.write('\n')
  339. appendFile.write(Accounts)
  340. appendFile.close()
  341.  
  342. @client.command()
  343. async def suggest(ctx,*, Suggestion):
  344. appendFile = open('Suggestions.txt', 'a')
  345. appendFile.write('\n')
  346. appendFile.write(f"{ctx.message.author}:{Suggestion}")
  347. appendFile.close()
  348. await ctx.send("Suggestion Added.")
  349.  
  350. @client.command()
  351. async def yt(ctx, *, search):
  352.  
  353. query_string = urllib.parse.urlencode({
  354. 'search_query': search
  355. })
  356. htm_content = urllib.request.urlopen(
  357. 'http://www.youtube.com/results?' + query_string
  358. )
  359. search_results = re.findall('href=\"\\/watch\\?v=(.{11})', htm_content.read().decode())
  360. await ctx.send(f'Results for `{search}`:')
  361. await ctx.send('http://www.youtube.com/watch?v=' + search_results[0])
  362.  
  363. @client.command()
  364. @commands.has_role("Admin")
  365. async def accountlist(ctx, type):
  366. with open('mc.txt', 'r') as f:
  367. for line in f:
  368. await ctx.send(line)
  369.  
  370. @client.command()
  371. async def join(ctx):
  372. try:
  373. self.vc = await ctx.message.author.voice.channel.connect()
  374. except:
  375. return
  376. #await ctx.send("The bot is already connected to a channel. Please disconnect from current channel by running: `!leave`")
  377. @client.command(aliases=["rps"], pass_context=True)
  378. async def rockpaperscissors(ctx, choice = None):
  379. if choice == None:
  380. await ctx.send(f"Please give a choice.\nUsage: " + (os.getenv("prefix"))+"rps (Rock, Paper, Scissors)")
  381. choice.lower()
  382. user = ctx.message.author.name
  383. choices = ["rock", "paper", "scissors"]
  384. computer = choices[randint(0,2)]
  385. if choice == computer:
  386. await ctx.send("It's a tie! I chose " + f"**{choice}**.")
  387. elif choice == "scissors":
  388. if computer == "rock":
  389. await ctx.send(f"You lost! I chose **Rock**, better luck next time, {user}.")
  390. else:
  391. await ctx.send(f"You won! I chose **Paper**, I'll get you next time, {user}.")
  392. elif choice == "rock":
  393. if computer == "paper":
  394. await ctx.send(f"You lost! I chose **Paper**, better luck next time, {user}.")
  395. else:
  396. await ctx.send(f"You won! I chose **Scissors**, I'll get you next time, {user}.")
  397. elif choice == "paper":
  398. if computer == "scissors":
  399. await ctx.send(f"You lost! I chose **Scissors**, better luck next time, {user}.")
  400. else:
  401. await ctx.send(f"You won! I chose **Rock**, I'll get you next time, {user}.")
  402. else:
  403. await ctx.send("Please give a **valid** choice! (Rock, Paper, Scissors)")
  404.  
  405. @client.command(aliases=["tod"])
  406. async def truthordare(ctx, tod = None):
  407. dares = ["Remove your socks with your teeth.", "Stop a car that is going down the street and tell them that their wheels are turning.", "Go next door with a measuring cup and ask for a cup of sugar.", "Write your name on the floor with your tongue.", "Go outside and pick exactly 40 blades of grass with a pair of tweezers.", "Stick a Hot Cheeto in you nose and leave it there for 5 minutes.", "Open Facebook, go to the account of the first person you see, and like every post on their wall going back to a year.", "Eat a whole piece of paper.", "Lick a car tire.", "Open your front door and howl like a wolf for 30 seconds.", "Put a bunch of honey on your nose and coat it with flour.", "Call your crush.", "Take a shot of pickle juice.", "Talk to a pillow like it’s your crush.", "Pretend you’re a bird and eat cereal off the floor using only your mouth.", "Make out with your hand.", "Let someone else style your hair and keep it that way for the rest of the day.", "Color one of your front teeth black. (Eyeliner works!)", "Pick your friend’s nose.", "Lick the bottom of your shoe.", "Fake cry.", "Make repulsive sounds while eating and drinking.", "Cross your eyes when talking.", "Talk without closing your mouth.", "Act like a random animal for the rest of the day.", "Get into a debate with a wall.", "Squirt your face with a squirt gun continuously while talking.", "See how many grapes you can stuff in your mouth.", "Hiccup in between each word (if possible.)", "Burp the alphabet(if possible.)", "Give yourself a face tatoo with a permanent marker.", "Dip your sock-covered feet in the toilet and don't dry it off for the rest of the day.", "Dump a bunch of legos on the floor and walk over it with your bare feet.", "Eat a spoonful of mustard.", "Eat a spoonful of ketchup.", "Eat a spoonful of mayonaise.", "Jump into a dumpster.", "Lift up the couch cushions, and if there is anything under it, you need to put it in your mouth for 10 seconds.", "Spin around 10 times and try to walk straight.", "Eat a raw egg.", "Write a letter to your doctor describing an embarrassing rash you have, and post it on Facebook.", "Let someone choose 3 random things from the refrigerator an dmix it together. Then you have to eat it.", "Stand up and do jumping jacks until your next turn.", "Rub your armpits and then lick your fingers.", "Dig through the trash and name everything you find.", "Run around outside yelling, “I have lice!”", "Go on Facebook live and read the back of a shampoo bottle.", "Call a 7-Eleven and ask if they’re open.", "Stand in the back yard and yell at the top of your lungs, “Nooooo! I was adopted!”", "Go outside in the driveway and do the disco without music.", "Call a car part store and tell them that you need a part for your Model T.", "Take a selfie with the toilet and post it online.", "Sniff everyone’s feet and rank them in order of freshest to stinkiest.", "Call a NY-style pizza place and ask them what the difference is between NY pizza and “real” pizza.", "Open your front door and loudly sing “Hallelujah!”", "Go outside and pretend you're cutting the grass with an invisible mower.", "Call a pizza place and ask if they use cruelty-free wheat in their dough.", "Prank call a near fast-food resurant.", "Call your mom and tell her you can't find a girlfriend in a very panicked voice.", "Take a plate of leftovers over to your neighbor, knock on their door, and say, “Welcome to the neighborhood” as if you'd never known them before.", "Call the library and ask if they carry a dictionary that translates British to American.", "Send a Snapchat of you pretending to cry because you just found out you were adopted.", "Go on Facebook and write `How do you spell facebook?` as your status.", "Go outside and hug a mailbox until at least three passersby have seen you.", "Go outside and try to summon the rain.", "Single the Star Spangled Banner in a British accent.", "Take a picture of a tampon and post it on Instagram.", "Take a picture of a condom and post it on Instagram.", "Call and random number, and when someone picks up, immediately start singing the National Anthem.", "Call Target and ask them if they deliver popcorn.", "Eat 10 Oreo cookies that are filled with mayo.", "Pluck a single nose hair.", "Eat a spoonful of wasabi (or any other spicy substance.)", "Lick the toilet seat.", "Take a picture of yourself next to bra and post in on Instagram.", "Eat a handful of uncooked rice.", "Wet your socks and freeze them.", "Coat your hands in food coloring and don’t wash them off for 10 minutes.", "Call a drug store and ask them which laxative is the most effective. After they answer, ask how many they have.", "Color your teeth with lipstick.", "Eat a spoonful of sugar and act like you're really hyper.", "Make up a rap about koalas.", "Put on mascara.", "Bite your toenails off.", "Mix orange juice and milk and drink it.", "Drink a soda and belch as loud as possible.", "Call a random girl from your class and tell her you want to break up.", "Skype/Facetime someone and pick your nose during conversation.", "Post something embarrassing on Facebook for 1 minute, then delete it.", "Knock on your neighbor's door and ask if they have a spare condom/tampon.", "Walk down the street in your underwear.", "Wear the opposite sex's clothing and walk down the street. Then take a selfie and post it to your social media accounts.", "Write on Facebook: `I'm a size 36 C.`", "Tie your shirt up to expose your midriff and twerk.", "Lick peanut butter off of someone's armpit.", "Lick the wall.", "Do the worm.", "Have a full conversation with yourself in a mirror.", "Put your shoes on the wrong feet and keep them there.", "Eat an ant.", "Sing the “I Love You” Barney song.", "Go outside and hug a tree.", "Make a hand puppet by drawing a face on your hand, and use your hand to say what you want to say.", "Hold your nose while talking.", "Shave one of your legs.", "Silently do the macarena."]
  408. truths = ['Who was your first kiss?', 'Are you a virgin?', 'What was the last thing you searched for on your phone?', 'If you had to choose between going naked or having your thoughts appear in thought bubbles above your head for everyone to read, which would you choose?', 'Have you ever walked in on your parents doing it?',"After you've dropped a piece of food, what's the longest time you've left it on the ground and then ate it?", "Have you ever tasted a booger?", "Have you ever played Cards Against Humanity with your parents?" ,"What's the first thing you would do if you woke up one day as the opposite sex?", "Have you ever peed in the pool?", "Did you have an imaginary friend growing up?", "Do you cover your eyes during a scary part in a movie?", "Have you ever practiced kissing in a mirror?", "Did your parents ever give you the “birds and the bees” talk?", "What is your guilty pleasure?", "What is your worst habit?", "Has anyone ever walked in on you when going #2 in the bathroom?", "Have you ever walked into a wall?", "Do you pick your nose?", "Do you sing in the shower?", "Have you ever peed yourself?", "What was your most embarrassing moment in public?", "Have you ever farted loudly in class?", "Do you ever talk to yourself in the mirror?", "You’re in a public restroom and just went #2, then you realized your stall has no toilet paper. What do you do?", "What would be in your web history that you’d be embarrassed if someone saw?", "Have you ever tried to take a sexy picture of yourself?", "Do you sleep with a stuffed animal?", "Do you drool in your sleep?", "Do you talk in your sleep?", "Who is your secret crush?", "What does your dream boy or girl look like?", "What is your go-to song for the shower?", "Do you write in a diary?", "What is something that no one else knows about you?", "Do you lick your plate?", "What was the last rate-R movie you watched?", "Have you ever pooped your pants?", "Have you ever had lice?", "What part of your body do you love and which part do you hate?", "Have you ever got caught doing something you shouldn’t?", "Do you like hanging out with your parents?", "Have you ever butt-dialed someone?", "Have you ever eaten something off the floor?", "Do you have a security blanket?", "When was the last time you brushed your teeth?", "What is something you’ve done to try to be ‘cooler’?", "How many selfies do you take a day?", "If you were home by yourself all day, what would you do?", "Do you still take bubble baths?", "Are you scared of the dark?", "What song on the radio do you sing with every time it comes on?", "Would you have voted for or against Trump?", "Do you dance when you’re by yourself?", "What is the most food you’ve eaten in a single sitting?", "Have you ever pretended to be sick to get out of something? If so, what was it?", "What app on your phone do you waste the most time on?", "Have you ever watched a movie you knew you shouldn’t?", "If you had to make out with any Disney character, who would it be?", "Have you ever accidentally hit something with your car?", "How many pancakes have you eaten in a single sitting?", "When was the last time you wet the bed?", "Do you have any silly nicknames?", "Do you have bad foot odor?", "What children’s movie could you watch over and over again?", "Who is one person you pretend to like, but actually don’t?", "Have you ever kept a library book?", "Tell us about a time you embarrassed yourself in front of a crush.", "How far would you go to land the guy or girl of your dreams?", "What is the most childish thing that you still do?", "Would you wear your shirt inside out for a whole day if someone paid you $100?", "The world ends next week and you can do anything you want (even if it's illegal). What would you do?", "Have you ever ding dong ditched someone?", "Do you pee in the shower?", "What is your biggest fear?", "Have you ever posted something on social media that you regret?", "Describe the strangest dream you've ever had. Did you like it?", "Have you ever cried because you missed your parents so much?", "What's the most unflattering school picture of you?", "What's the longest time you've stayed in the bathroom, and why did you stay for that long?", "Have you ever waved at someone thinking they saw you when really they didn't? What did you do when you realized it?", "Have you ever been caught checking someone out?", "If you could suddenly become invisible, what would you do?", "Have you ever thought about cheating on your partner?", "Has your boyfriend or girlfriend ever embarrassed you?", "If you could go back in time in erase one thing you said or did, what would it be?", "If you were reborn, what decade would you want to be born in?", "If someone offered you $1 million dollars to break up with your girlfriend/boyfriend, would you do it?", "Would you rather live with no internet or no A/C or heating?", "If you lost one day of your life every time you said a swear word, would you try not to do it?", "If you could only hear one song for the rest of your life, what would it be?", "Would you choose to save 100 people without anyone knowing about it or not save them but have everyone praise you for it?", "Would you rather lose your sex organs forever or gain 200 pounds?", "If you were allowed to marry more than one person, would you? Who would you choose to marry?", "What is your biggest pet peeve?", "Would you trade in your dog for a million dollars?", "Would you trade your sibling in for a million dollars?", "Who is your favorite? Mom or Dad?", "What is the most illegal thing you have ever done?", "Have you ever tasted your sweat?", "Have you ever farted and then blamed someone else?", "How often do you wash your undergarments?", "Do you think you'll marry your current girlfriend/boyfriend?", "What was the last thing you texted?", "What color underwear are you wearing right now?", "How would you rate your looks on a scale of 1 to 10?"]
  409. if tod == None:
  410. await ctx.send("Please give a choice! (Truth, Dare)")
  411. tod.lower()
  412. if tod == "truth":
  413. await ctx.send(f'{random.choice(truths)}')
  414. elif tod == "dare":
  415. await ctx.send(f'{random.choice(dares)}')
  416. else:
  417. await ctx.send("Please give a **valid** choice! (Truth, Dare)")
  418.  
  419. #@client.event
  420. #async def on_message(message):
  421. # e = discord.Embed(title=":x: **Hey!** You're not allowed to use that word here! :x:")
  422. # channel = message.channel
  423. # contents = message.content.split(" ")
  424. # for word in contents:
  425. # if word.upper() in chat_filter:
  426. # try:
  427. # await message.delete()
  428. # await channel.send(embed = e)
  429. # except:
  430. # await channel.send("Error")
  431.  
  432. @client.event
  433. async def on_raw_reaction_add(payload):
  434. message_id = payload.message_id
  435. if message_id == 'MESSAGE_ID':
  436. guild_id = payload.guild_id
  437. guild = discord.utils.find(lambda g : g.id == guild_id, client.guilds)
  438.  
  439. if payload.emoji.name == 'EMOJI_NAME':
  440. role = discord.utils.get(guild.roles, name='ROLE_NAME')
  441. elif payload.emoji.name == 'EMOJI_NAME':
  442. role = discord.utils.get(guild.roles, name='ROLE_NAME')
  443. else:
  444. role = discord.utils.get(guild.roles, name = payload.emoji.name)
  445. if role is not None:
  446. member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members)
  447. if member is not None:
  448. await member.add_roles(role)
  449. print("done")
  450. else:
  451. print("Member not found.")
  452. else:
  453. print("Role not found.")
  454.  
  455. @client.command()
  456. async def remind(ctx, times:int = None, timem:int = None, timeh:int = None, *, reminder = None):
  457. if times == None:
  458. await ctx.send("Please specify the amount of seconds to remind you in.\nFormat: `!remind (seconds) (minutes) (hours) (reminder)`")
  459. return
  460. if timem == None:
  461. await ctx.send("Please specify the amount of minutes to remind you in.\nFormat: `!remind (seconds) (minutes) (hours) (reminder)`")
  462. return
  463. if timeh == None:
  464. await ctx.send("Please specify the amount of hours to remind you in.\nFormat: `!remind (seconds) (minutes) (hours) (reminder)`")
  465. return
  466. await ctx.send(f"{ctx.author.name}, you will be reminded in {timeh} hours, {timem} minutes, {times} seconds, to {reminder}.")
  467. await asyncio.sleep(timeh*3600 + timem*60 + times)
  468. await ctx.author.send(f"It's been {timeh} hours, {timem} minutes, {times} seconds , here is your reminder: {reminder}")
  469.  
  470. @client.command(aliases=["wyr", "w"])
  471. async def wouldyourather(ctx):
  472. wyr1 = ["Remove your socks with your teeth.", "Stop a car that is going down the street and tell them that their wheels are turning.", "Go next door with a measuring cup and ask for a cup of sugar.", "Write your name on the floor with your tongue.", "Go outside and pick exactly 40 blades of grass with a pair of tweezers.", "Stick a Hot Cheeto in you nose and leave it there for 5 minutes.", "Open Facebook, go to the account of the first person you see, and like every post on their wall going back to a year.", "Eat a whole piece of paper.", "Lick a car tire.", "Open your front door and howl like a wolf for 30 seconds.", "Put a bunch of honey on your nose and coat it with flour.", "Call your crush.", "Take a shot of pickle juice.", "Talk to a pillow like it’s your crush.", "Pretend you’re a bird and eat cereal off the floor using only your mouth.", "Make out with your hand.", "Let someone else style your hair and keep it that way for the rest of the day.", "Color one of your front teeth black. (Eyeliner works!)", "Pick your friend’s nose.", "Lick the bottom of your shoe.", "Fake cry.", "Make repulsive sounds while eating and drinking.", "Cross your eyes when talking.", "Talk without closing your mouth.", "Act like a random animal for the rest of the day.", "Get into a debate with a wall.", "Squirt your face with a squirt gun continuously while talking.", "See how many grapes you can stuff in your mouth.", "Hiccup in between each word (if possible.)", "Burp the alphabet(if possible.)", "Give yourself a face tatoo with a permanent marker.", "Dip your sock-covered feet in the toilet and don't dry it off for the rest of the day.", "Dump a bunch of legos on the floor and walk over it with your bare feet.", "Eat a spoonful of mustard.", "Eat a spoonful of ketchup.", "Eat a spoonful of mayonaise.", "Jump into a dumpster.", "Lift up the couch cushions, and if there is anything under it, you need to put it in your mouth for 10 seconds.", "Spin around 10 times and try to walk straight.", "Eat a raw egg.", "Write a letter to your doctor describing an embarrassing rash you have, and post it on Facebook.", "Let someone choose 3 random things from the refrigerator an dmix it together. Then you have to eat it.", "Stand up and do jumping jacks until your next turn.", "Rub your armpits and then lick your fingers.", "Dig through the trash and name everything you find.", "Run around outside yelling, “I have lice!”", "Go on Facebook live and read the back of a shampoo bottle.", "Call a 7-Eleven and ask if they’re open.", "Stand in the back yard and yell at the top of your lungs, “Nooooo! I was adopted!”", "Go outside in the driveway and do the disco without music.", "Call a car part store and tell them that you need a part for your Model T.", "Take a selfie with the toilet and post it online.", "Sniff everyone’s feet and rank them in order of freshest to stinkiest.", "Call a NY-style pizza place and ask them what the difference is between NY pizza and “real” pizza.", "Open your front door and loudly sing “Hallelujah!”", "Go outside and pretend you're cutting the grass with an invisible mower.", "Call a pizza place and ask if they use cruelty-free wheat in their dough.", "Prank call a near fast-food resurant.", "Call your mom and tell her you can't find a girlfriend in a very panicked voice.", "Take a plate of leftovers over to your neighbor, knock on their door, and say, “Welcome to the neighborhood” as if you'd never known them before.", "Call the library and ask if they carry a dictionary that translates British to American.", "Send a Snapchat of you pretending to cry because you just found out you were adopted.", "Go on Facebook and write `How do you spell facebook?` as your status.", "Go outside and hug a mailbox until at least three passersby have seen you.", "Go outside and try to summon the rain.", "Single the Star Spangled Banner in a British accent.", "Take a picture of a tampon and post it on Instagram.", "Take a picture of a condom and post it on Instagram.", "Call and random number, and when someone picks up, immediately start singing the National Anthem.", "Call Target and ask them if they deliver popcorn.", "Eat 10 Oreo cookies that are filled with mayo.", "Pluck a single nose hair.", "Eat a spoonful of wasabi (or any other spicy substance.)", "Lick the toilet seat.", "Take a picture of yourself next to bra and post in on Instagram.", "Eat a handful of uncooked rice.", "Wet your socks and freeze them.", "Coat your hands in food coloring and don’t wash them off for 10 minutes.", "Call a drug store and ask them which laxative is the most effective. After they answer, ask how many they have.", "Color your teeth with lipstick.", "Eat a spoonful of sugar and act like you're really hyper.", "Make up a rap about koalas.", "Put on mascara.", "Bite your toenails off.", "Mix orange juice and milk and drink it.", "Drink a soda and belch as loud as possible.", "Call a random girl from your class and tell her you want to break up.", "Skype/Facetime someone and pick your nose during conversation.", "Post something embarrassing on Facebook for 1 minute, then delete it.", "Knock on your neighbor's door and ask if they have a spare condom/tampon.", "Walk down the street in your underwear.", "Wear the opposite sex's clothing and walk down the street. Then take a selfie and post it to your social media accounts.", "Write on Facebook: `I'm a size 36 C.`", "Tie your shirt up to expose your midriff and twerk.", "Lick peanut butter off of someone's armpit.", "Lick the wall.", "Do the worm.", "Have a full conversation with yourself in a mirror.", "Put your shoes on the wrong feet and keep them there.", "Eat an ant.", "Sing the “I Love You” Barney song.", "Go outside and hug a tree.", "Make a hand puppet by drawing a face on your hand, and use your hand to say what you want to say.", "Hold your nose while talking.", "Shave one of your legs.", "Silently do the macarena."]
  473. wyr2 = ['Who was your first kiss?', 'Are you a virgin?', 'What was the last thing you searched for on your phone?', 'If you had to choose between going naked or having your thoughts appear in thought bubbles above your head for everyone to read, which would you choose?', 'Have you ever walked in on your parents doing it?',"After you've dropped a piece of food, what's the longest time you've left it on the ground and then ate it?", "Have you ever tasted a booger?", "Have you ever played Cards Against Humanity with your parents?" ,"What's the first thing you would do if you woke up one day as the opposite sex?", "Have you ever peed in the pool?", "Did you have an imaginary friend growing up?", "Do you cover your eyes during a scary part in a movie?", "Have you ever practiced kissing in a mirror?", "Did your parents ever give you the “birds and the bees” talk?", "What is your guilty pleasure?", "What is your worst habit?", "Has anyone ever walked in on you when going #2 in the bathroom?", "Have you ever walked into a wall?", "Do you pick your nose?", "Do you sing in the shower?", "Have you ever peed yourself?", "What was your most embarrassing moment in public?", "Have you ever farted loudly in class?", "Do you ever talk to yourself in the mirror?", "You’re in a public restroom and just went #2, then you realized your stall has no toilet paper. What do you do?", "What would be in your web history that you’d be embarrassed if someone saw?", "Have you ever tried to take a sexy picture of yourself?", "Do you sleep with a stuffed animal?", "Do you drool in your sleep?", "Do you talk in your sleep?", "Who is your secret crush?", "What does your dream boy or girl look like?", "What is your go-to song for the shower?", "Do you write in a diary?", "What is something that no one else knows about you?", "Do you lick your plate?", "What was the last rate-R movie you watched?", "Have you ever pooped your pants?", "Have you ever had lice?", "What part of your body do you love and which part do you hate?", "Have you ever got caught doing something you shouldn’t?", "Do you like hanging out with your parents?", "Have you ever butt-dialed someone?", "Have you ever eaten something off the floor?", "Do you have a security blanket?", "When was the last time you brushed your teeth?", "What is something you’ve done to try to be ‘cooler’?", "How many selfies do you take a day?", "If you were home by yourself all day, what would you do?", "Do you still take bubble baths?", "Are you scared of the dark?", "What song on the radio do you sing with every time it comes on?", "Would you have voted for or against Trump?", "Do you dance when you’re by yourself?", "What is the most food you’ve eaten in a single sitting?", "Have you ever pretended to be sick to get out of something? If so, what was it?", "What app on your phone do you waste the most time on?", "Have you ever watched a movie you knew you shouldn’t?", "If you had to make out with any Disney character, who would it be?", "Have you ever accidentally hit something with your car?", "How many pancakes have you eaten in a single sitting?", "When was the last time you wet the bed?", "Do you have any silly nicknames?", "Do you have bad foot odor?", "What children’s movie could you watch over and over again?", "Who is one person you pretend to like, but actually don’t?", "Have you ever kept a library book?", "Tell us about a time you embarrassed yourself in front of a crush.", "How far would you go to land the guy or girl of your dreams?", "What is the most childish thing that you still do?", "Would you wear your shirt inside out for a whole day if someone paid you $100?", "The world ends next week and you can do anything you want (even if it's illegal). What would you do?", "Have you ever ding dong ditched someone?", "Do you pee in the shower?", "What is your biggest fear?", "Have you ever posted something on social media that you regret?", "Describe the strangest dream you've ever had. Did you like it?", "Have you ever cried because you missed your parents so much?", "What's the most unflattering school picture of you?", "What's the longest time you've stayed in the bathroom, and why did you stay for that long?", "Have you ever waved at someone thinking they saw you when really they didn't? What did you do when you realized it?", "Have you ever been caught checking someone out?", "If you could suddenly become invisible, what would you do?", "Have you ever thought about cheating on your partner?", "Has your boyfriend or girlfriend ever embarrassed you?", "If you could go back in time in erase one thing you said or did, what would it be?", "If you were reborn, what decade would you want to be born in?", "If someone offered you $1 million dollars to break up with your girlfriend/boyfriend, would you do it?", "Would you rather live with no internet or no A/C or heating?", "If you lost one day of your life every time you said a swear word, would you try not to do it?", "If you could only hear one song for the rest of your life, what would it be?", "Would you choose to save 100 people without anyone knowing about it or not save them but have everyone praise you for it?", "Would you rather lose your sex organs forever or gain 200 pounds?", "If you were allowed to marry more than one person, would you? Who would you choose to marry?", "What is your biggest pet peeve?", "Would you trade in your dog for a million dollars?", "Would you trade your sibling in for a million dollars?", "Who is your favorite? Mom or Dad?", "What is the most illegal thing you have ever done?", "Have you ever tasted your sweat?", "Have you ever farted and then blamed someone else?", "How often do you wash your undergarments?", "Do you think you'll marry your current girlfriend/boyfriend?", "What was the last thing you texted?", "What color underwear are you wearing right now?", "How would you rate your looks on a scale of 1 to 10?"]
  474. embed = discord.Embed(colour=ctx.author.color, timestamp=ctx.message.created_at)
  475. embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
  476. embed.add_field(name=f'Would You Rather...', value = f'{random.choice(wyr1)}', inline=False)
  477. embed.add_field(name=f'Or...', value = f'{random.choice(wyr2)}', inline=False)
  478. await ctx.send(embed=embed)
  479.  
  480. @client.command()
  481. async def tag(ctx, tag):
  482. name=(tag)
  483. searchfile = open("tags.txt", "r")
  484. for line in searchfile:
  485. if name in line:
  486. embed = discord.Embed(colour=discord.Colour.red(),timestamp=ctx.message.created_at)
  487. embed.add_field(name=f"`tags for {tag}:`", value=line)
  488. await ctx.send(embed = embed)
  489.  
  490. @client.command(aliases=["at"])
  491. @commands.has_role("Programmer")
  492. async def addtag(ctx, tag):
  493. appendFile = open('tags.txt', 'a')
  494. appendFile.write('\n')
  495. appendFile.write(tag)
  496. appendFile.close()
  497. await ctx.send(f":white_check_mark: Tag: {tag}, added.")
  498.  
  499. @client.command()
  500. async def apply(ctx,*, application):
  501. if application == "format":
  502. await ctx.send('**Example Question 1:**\n\n**Example Question 2:**\n\n**Example Question 3:**')
  503. return
  504. appendFile = open('applications.txt', 'a')
  505. appendFile.write('\n')
  506. appendFile.write(f"{ctx.message.author}:{application}")
  507. appendFile.close()
  508. await ctx.send("**Successfully Applied For Staff!**. We will return to you as soon as possible! Thanks for applying!\nWARNING: Any false applications or spammed applications will result in a punishment.")
  509.  
  510. @apply.error
  511. async def apply_error(ctx, error):
  512. if isinstance(error, commands.errors.MissingRequiredArgument):
  513. await ctx.send(f'Please send your application after **!**apply\n**Format: !apply (application|format)**')
  514.  
  515.  
  516. @client.event
  517. async def on_message(message):
  518. with open('users.json', 'r+') as f:
  519. users = json.load(f)
  520. server = message.guild.id
  521. await update_data(server, users, message.author)
  522. await add_experience(server, users, message.author, 5)
  523. await level_up(server, users, message.author, message.channel)
  524. with open('users.json', 'r+') as f:
  525. json.dump(users, f)
  526. async def update_data(server, users, user):
  527. if not str(server) in users:
  528. users[str(server)] = {}
  529. users[str(user.id)] = {}
  530. users[str(user.id)]['experience'] = 0
  531. users[str(user.id)]['level'] = 1
  532. async def add_experience(server, users, user, exp):
  533. users[str(user.id)]['experience'] += exp
  534. async def level_up(server, users, user, channel):
  535. experience = users[str(user.id)]['experience']
  536. lvl_start = users[str(user.id)]['level']
  537. lvl_end = int(experience ** (1/4))
  538. if lvl_start < lvl_end:
  539. await channel.send(f':tada: Congrats {user.mention}, you leveled up to level {lvl_end}!')
  540. users[str(user.id)]['level']= lvl_end
  541.  
  542. client.run(token)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement