-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/wit 132 Implement guessing functionality #54
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Daniel, looks great so far! I've suggested a few minor style changes and bugfixes as I found some errors while testing. Let me know if you have any questions!
elif eval(current_input_math) != 24: | ||
await self.update_message_incorrect( | ||
interaction, "Sorry, that's not 24!" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a condition and message for if the user enters an input that causes an error when evaluated (e.g. they only input an open parenthesis, only have two numbers without any operators, click equals without having inputted anything, etc.), as this currently causes an error and a 'This interaction failed' message.
cogs/24.py
Outdated
embed = discord.Embed(title="24", color=discord.Color.orange()) | ||
|
||
embed.add_field( | ||
name="Your numbers are:", | ||
value=f"` {self.numbers[0]} {self.numbers[1]} {self.numbers[2]} {self.numbers[3]} `", | ||
inline=False, | ||
) | ||
|
||
embed.add_field( | ||
name="Input:", value="`" + self.current_input + "`", inline=False | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this repeated code into a function which returns the embed. You can call this function at the start of each update_message
function (might have to pass in the colour), then add the unique fields + respond to the interaction afterwards!
# if button_id in self.numbers: | ||
# item.disabled = True | ||
|
||
await self.update_message(interaction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: katejoh <[email protected]>
Co-authored-by: katejoh <[email protected]>
No description provided.