-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Rock paper scissors game #1333
base: dev
Are you sure you want to change the base?
Rock paper scissors game #1333
Conversation
Closes #495
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.
e parabens |
} | ||
|
||
async run ({ t, author, channel, flags }, choice, betValue) { | ||
console.log(betValue) |
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.
What the dog doing here
const choice1 = _choice1[0].toLowerCase() | ||
const choice2 = _choice2[0].toLowerCase() | ||
|
||
if (choice1 === choice2) return 'draw' |
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.
switch case could be used here, but meh
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.
could? since It's checking both choices. Also, it's more lines and ugly!
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.
switch case would look better to read imho
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.
Not only that, but it also performs better
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.
Remove the console log, and its done.
"bet": { | ||
"draw": "You balance hasn't changed!", | ||
"win": "Nice! You have won **$t(commons:currencyWithCount, { 'count': {{count}} })**", | ||
"lose": "Whoops! You lose **$t(commons:currencyWithCount, { 'count': {{count}} })**" |
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.
"lose": "Whoops! You lose **$t(commons:currencyWithCount, { 'count': {{count}} })**" | |
"lose": "Whoops! You lost **$t(commons:currencyWithCount, { 'count': {{count}} })**" |
"lose": "You lose!", | ||
"notEnoughMoney": "You don't have this enough money to bet", | ||
"bet": { | ||
"draw": "You balance hasn't changed!", |
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.
"draw": "You balance hasn't changed!", | |
"draw": "Your balance hasn't changed!", |
"draw": "It's a draw!", | ||
"win": "You win!", | ||
"lose": "You lose!", | ||
"notEnoughMoney": "You don't have this enough money to bet", |
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.
"notEnoughMoney": "You don't have this enough money to bet", | |
"notEnoughMoney": "You don't have enough money to bet.", |
"rockpaperscissors": { | ||
"commandDescription": "Plays Rock Paper Scissors with the bot", | ||
"commandUsage": "<rock, paper or scissors> [money to bet]", | ||
"noChoice": "You have to give me your choice, either rock, paper or scissors", |
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.
"noChoice": "You have to give me your choice, either rock, paper or scissors", | |
"noChoice": "You have to choose either rock, paper, or scissors", |
"notEnoughMoney": "You don't have this enough money to bet", | ||
"bet": { | ||
"draw": "You balance hasn't changed!", | ||
"win": "Nice! You have won **$t(commons:currencyWithCount, { 'count': {{count}} })**", |
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.
"win": "Nice! You have won **$t(commons:currencyWithCount, { 'count': {{count}} })**", | |
"win": "Nice! You won **$t(commons:currencyWithCount, { 'count': {{count}} })**", |
Closes #495