-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredesignedbot.py
More file actions
47 lines (39 loc) · 1.7 KB
/
redesignedbot.py
File metadata and controls
47 lines (39 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import discord
import random
from discord.ext import commands
bot = commands.Bot(command_prefix=".")
@bot.event
async def on_ready():
print("Let's get started!")
@bot.command()
async def hello(ctx):
await ctx.reply('Hello!')
@bot.command()
async def rps(ctx, message):
answer = message.lower()
choice = ["rock", "paper", "scissors"]
computers_answer = random.choice(choice)
if answer not in choice:
await ctx.reply("This is not a valid choice. Choose one of these: rock, paper, scissors.")
else:
if computers_answer == answer:
await ctx.reply("It's a tie :/.")
if computers_answer == "rock":
if answer == "paper":
await ctx.reply(f"You win! I chose {computers_answer} and you chose {answer}!")
if computers_answer == "rock":
if answer == "scissors":
await ctx.reply(f"You loose! I chose {computers_answer} and you chose {answer}!")
if computers_answer == "paper":
if answer == "rock":
await ctx.reply(f"You loose! I chose {computers_answer} and you chose {answer}!")
if computers_answer == "paper":
if answer == "scissors":
await ctx.reply(f"You win! I chose {computers_answer} and you chose {answer}!")
if computers_answer == "scissors":
if answer == "rock":
await ctx.reply(f"You win! I chose {computers_answer} and you chose {answer}!")
if computers_answer == "scissors":
if answer == "paper":
await ctx.reply(f"You loose! I chose {computers_answer} and you chose {answer}!")
bot.run('MTI3MzYyMzE0NDAxNTQ2MjQ3Mg.G68H9O.mwdzHLKpuUbxXux9gAVaENfvi0jkMZ4Iuyi4KY')