|
|
@@ -19,19 +19,20 @@ class Games(commands.Cog):
|
|
|
help="Roll two dice."
|
|
|
)
|
|
|
async def dice(self, ctx: commands.Context, amount: Optional[int], sides: Optional[int]):
|
|
|
- if amount and amount < 1:
|
|
|
- await ctx.send("You want me to roll less as one die? How!?")
|
|
|
- elif amount and amount > 25:
|
|
|
+ if not amount:
|
|
|
+ amount = 2
|
|
|
+ if not sides:
|
|
|
+ sides = 6
|
|
|
+
|
|
|
+ if amount < 1:
|
|
|
+ await ctx.send("You want me to roll less than one die? How!?")
|
|
|
+ elif amount > 25:
|
|
|
await ctx.send("I can not hold so many dice at one time.")
|
|
|
- elif sides and sides < 2:
|
|
|
+ elif sides < 2:
|
|
|
await ctx.send("A die has physical minimum of 2 sides. Don't ask for impossible objects.")
|
|
|
+ elif sides > 256:
|
|
|
+ await ctx.send("My tiny hands can not handle such large dice. Even if both are virtual.")
|
|
|
else:
|
|
|
- if sides:
|
|
|
- sides = sides
|
|
|
- else:
|
|
|
- sides = 6
|
|
|
- if not amount:
|
|
|
- amount = 2
|
|
|
embed = discord.Embed(title = "Dice roll", description=f"Rolling {amount} dice, with {sides} sides.")
|
|
|
while amount > 0:
|
|
|
embed.insert_field_at(0, name=f"Die {amount}", value=random.randint(1, sides), inline=True)
|
|
|
@@ -55,6 +56,21 @@ class Games(commands.Cog):
|
|
|
"Ask a question you tease!",
|
|
|
"You will die alone.",
|
|
|
]
|
|
|
+ elif question.strip().count(" ") == 0:
|
|
|
+ messages = [
|
|
|
+ "What?",
|
|
|
+ "That is not a question",
|
|
|
+ "Can you use more than one word?",
|
|
|
+ "What is the question?",
|
|
|
+ "Sorry?"
|
|
|
+ ]
|
|
|
+ elif question.strip()[-1] != "?":
|
|
|
+ messages = [
|
|
|
+ "Did you forget to end with a question mark?",
|
|
|
+ "Is that a statement or question?",
|
|
|
+ "Don't questions usually end with a question mark?",
|
|
|
+ "Don't forget to use punctuation."
|
|
|
+ ]
|
|
|
else:
|
|
|
messages = [
|
|
|
"Yes.",
|
|
|
@@ -79,6 +95,6 @@ class Games(commands.Cog):
|
|
|
"Ask again later.",
|
|
|
"I don't know.",
|
|
|
"Unpredictable.",
|
|
|
- "Unkown",
|
|
|
+ "Unknown",
|
|
|
]
|
|
|
await ctx.send(random.choice(messages))
|