Add a unique message for when someone selects the same vote in the dropdown that they are already voting for
This commit is contained in:
parent
b30e8deb68
commit
3b7a44e133
1 changed files with 13 additions and 0 deletions
|
|
@ -5,6 +5,19 @@ export async function selectQuote(data: any): Promise<object> {
|
||||||
let userID = data.member.user.id;
|
let userID = data.member.user.id;
|
||||||
let oldVote = db.bracket.users[userID];
|
let oldVote = db.bracket.users[userID];
|
||||||
|
|
||||||
|
|
||||||
|
// Assert votes are different
|
||||||
|
if (oldVote === vote) {
|
||||||
|
return {
|
||||||
|
type: 4,
|
||||||
|
data: {
|
||||||
|
content: `You're already voting for that quote!`,
|
||||||
|
flags: 1 << 6,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Set quote to 0 if it hasn't been voted for yet
|
// Set quote to 0 if it hasn't been voted for yet
|
||||||
if (!db.bracket.votes[vote]) {
|
if (!db.bracket.votes[vote]) {
|
||||||
db.bracket.votes[vote] = 0;
|
db.bracket.votes[vote] = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue