Advertisement
Guest User

here boi

a guest
Jan 20th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.54 KB | None | 0 0
  1. @bot.command(pass_context=True)
  2. async def coinflip(ctx):
  3.     quitflip = 0
  4.     author = ctx.message.author
  5.     authid = ctx.message.author.id
  6.     authname = ctx.message.author.name
  7.     authtag = ctx.message.author.discriminator
  8.     x=1
  9.     while True:
  10.         embed = discord.Embed(title="Coinflip", description="Choose ct or t to flip", color=0x00ff00)
  11.         embed.set_author(name="Xel>Coinflip", icon_url='https://cdn.discordapp.com/avatars/529241721851084810/39fdeb4d58af20e148e93a2f523cd77f.png?size=128')
  12.  
  13.         await bot.say(embed=embed)
  14.         reply = await bot.wait_for_message(author=author)
  15.         if reply.content == "t":
  16.             break
  17.         if reply.content == "ct":
  18.             break
  19.         if reply.content == "quitflip":
  20.             quitflip = 1
  21.         print(reply.content, "was flipped")
  22.  
  23.  
  24.         #code
  25.     if quitflip == 0:
  26.         embed = discord.Embed(title="Coinflip", description="The coin is flipping...", color=0x00ff00)
  27.         embed.set_author(name="Xel>Coinflip", icon_url='https://cdn.discordapp.com/avatars/529241721851084810/39fdeb4d58af20e148e93a2f523cd77f.png?size=128')
  28.         await bot.say(embed=embed)
  29.         #await bot.send_file(ctx.message.channel, "coinflip.gif", filename=None, content=None, tts=False)
  30.         time.sleep(3)
  31.         rs = random.randint(0,9999)
  32.        
  33.         random.seed(rs, 2)
  34.  
  35.         for i in range(1,10):
  36.             for x in range(1,10):
  37.                 print(random.randint(0,9999))
  38.                 rs = random.randint(0,9999)
  39.                 random.seed(rs, 2)
  40.  
  41.         print(random.randint(0,9999))
  42.         final = random.randint(0,9999)
  43.         if final <= 5000:
  44.             if reply.content == "t":
  45.                 embed = discord.Embed(title="T side won", description="Your side (T) won! :ok_hand: ", color=0x00ff00)
  46.                 embed.set_author(name="Xel>Coinflip Results", icon_url='https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fimages.akamai.steamusercontent.com%2Fugc%2F450664324651751354%2F8F630A0B1E5E2026D347894A877E1386D148F478%2F&f=1')
  47.                 await bot.say(embed=embed)
  48.             elif reply.content == "ct":
  49.                 embed = discord.Embed(title="T side won", description="Your side (CT) lost. :cry: ", color=0x00ff00)
  50.                 embed.set_author(name="Xel>Coinflip Results", icon_url='https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fimages.akamai.steamusercontent.com%2Fugc%2F450664324651751354%2F8F630A0B1E5E2026D347894A877E1386D148F478%2F&f=1')
  51.                 await bot.say(embed=embed)
  52.         elif final >=4999:
  53.             if reply.content == "ct":
  54.                 embed = discord.Embed(title="CT side won", description="Your side (CT) won! :ok_hand: ", color=0x00ff00)
  55.                 embed.set_author(name="Xel>Coinflip Results", icon_url='https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fvignette1.wikia.nocookie.net%2Fcswikia%2Fimages%2F4%2F4c%2FCsgo_CT_icon_alt.png%2Frevision%2Flatest%3Fcb%3D20151222191721&f=1')
  56.                 await bot.say(embed=embed)
  57.             elif reply.content == "t":
  58.                 embed = discord.Embed(title="CT side won", description="Your side (T) lost. :cry: ", color=0x00ff00)
  59.                 embed.set_author(name="Xel>Coinflip Results", icon_url='https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fvignette1.wikia.nocookie.net%2Fcswikia%2Fimages%2F4%2F4c%2FCsgo_CT_icon_alt.png%2Frevision%2Flatest%3Fcb%3D20151222191721&f=1')
  60.                 await bot.say(embed=embed)
  61.     print("random numbers genned")
  62.     if quitflip == 1:
  63.         embed = discord.Embed(title="Quitflip Cancelled.", color=0x00ff00)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement