Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @bot.command(pass_context=True)
- async def coinflip(ctx):
- quitflip = 0
- author = ctx.message.author
- authid = ctx.message.author.id
- authname = ctx.message.author.name
- authtag = ctx.message.author.discriminator
- x=1
- while True:
- embed = discord.Embed(title="Coinflip", description="Choose ct or t to flip", color=0x00ff00)
- embed.set_author(name="Xel>Coinflip", icon_url='https://cdn.discordapp.com/avatars/529241721851084810/39fdeb4d58af20e148e93a2f523cd77f.png?size=128')
- await bot.say(embed=embed)
- reply = await bot.wait_for_message(author=author)
- if reply.content == "t":
- break
- if reply.content == "ct":
- break
- if reply.content == "quitflip":
- quitflip = 1
- print(reply.content, "was flipped")
- #code
- if quitflip == 0:
- embed = discord.Embed(title="Coinflip", description="The coin is flipping...", color=0x00ff00)
- embed.set_author(name="Xel>Coinflip", icon_url='https://cdn.discordapp.com/avatars/529241721851084810/39fdeb4d58af20e148e93a2f523cd77f.png?size=128')
- await bot.say(embed=embed)
- #await bot.send_file(ctx.message.channel, "coinflip.gif", filename=None, content=None, tts=False)
- time.sleep(3)
- rs = random.randint(0,9999)
- random.seed(rs, 2)
- for i in range(1,10):
- for x in range(1,10):
- print(random.randint(0,9999))
- rs = random.randint(0,9999)
- random.seed(rs, 2)
- print(random.randint(0,9999))
- final = random.randint(0,9999)
- if final <= 5000:
- if reply.content == "t":
- embed = discord.Embed(title="T side won", description="Your side (T) won! :ok_hand: ", color=0x00ff00)
- 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')
- await bot.say(embed=embed)
- elif reply.content == "ct":
- embed = discord.Embed(title="T side won", description="Your side (CT) lost. :cry: ", color=0x00ff00)
- 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')
- await bot.say(embed=embed)
- elif final >=4999:
- if reply.content == "ct":
- embed = discord.Embed(title="CT side won", description="Your side (CT) won! :ok_hand: ", color=0x00ff00)
- 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')
- await bot.say(embed=embed)
- elif reply.content == "t":
- embed = discord.Embed(title="CT side won", description="Your side (T) lost. :cry: ", color=0x00ff00)
- 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')
- await bot.say(embed=embed)
- print("random numbers genned")
- if quitflip == 1:
- embed = discord.Embed(title="Quitflip Cancelled.", color=0x00ff00)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement