Skip to content

Commit

Permalink
✨ send the actual rejection cause they can be diff
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico105 committed Jun 15, 2021
1 parent 025ae94 commit 67381fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ client.on('message', (message) => {
client.giveawaysManager.reroll(messageID).then(() => {
message.channel.send('Success! Giveaway rerolled!');
}).catch((err) => {
message.channel.send('No giveaway found for ' + messageID + ', please check and try again');
message.channel.send(`An error has occurred, please check and try again.\n\`${err}\``);
});
}
});
Expand Down Expand Up @@ -182,7 +182,7 @@ client.on('message', (message) => {
const numberOfSecondsMax = client.giveawaysManager.options.updateCountdownEvery / 1000;
message.channel.send('Success! Giveaway will update in less than ' + numberOfSecondsMax + ' seconds.');
}).catch((err) => {
message.channel.send('No giveaway found for ' + messageID + ', please check and try again');
message.channel.send(`An error has occurred, please check and try again.\n\`${err}\``);
});
}
});
Expand Down Expand Up @@ -210,7 +210,7 @@ client.on('message', (message) => {
client.giveawaysManager.delete(messageID).then(() => {
message.channel.send('Success! Giveaway deleted!');
}).catch((err) => {
message.channel.send('No giveaway found for ' + messageID + ', please check and try again');
message.channel.send(`An error has occurred, please check and try again.\n\`${err}\``);
});
}
});
Expand All @@ -232,7 +232,7 @@ client.on('message', (message) => {
client.giveawaysManager.end(messageID).then(() => {
message.channel.send('Success! Giveaway ended!');
}).catch((err) => {
message.channel.send('No giveaway found for ' + messageID + ', please check and try again');
message.channel.send(`An error has occurred, please check and try again.\n\`${err}\``);
});
}
});
Expand Down Expand Up @@ -393,8 +393,6 @@ client.giveawaysManager.reroll(messageID, {
congrat: ':tada: New winner(s): {winners}! Congratulations, you won **{prize}**!\n{messageURL}',
error: 'No valid participations, no new winner(s) can be chosen!'
}
}).catch((err) => {
message.channel.send('No giveaway found for ' + messageID + ', please check and try again');
});
```

Expand Down
16 changes: 8 additions & 8 deletions examples/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ client.on('message', (message) => {
const messageID = args[0];
client.giveawaysManager.reroll(messageID).then(() => {
message.channel.send('Success! Giveaway rerolled!');
}).catch(() => {
message.channel.send('No giveaway found for ' + messageID + ', please check and try again');
}).catch((err) => {
message.channel.send(`An error has occurred, please check and try again.\n\`${err}\``);
});
}

Expand All @@ -63,26 +63,26 @@ client.on('message', (message) => {
// Here, we can calculate the time after which we are sure that the lib will update the giveaway
const numberOfSecondsMax = client.giveawaysManager.options.updateCountdownEvery / 1000;
message.channel.send('Success! Giveaway will update in less than ' + numberOfSecondsMax + ' seconds.');
}).catch(() => {
message.channel.send('No giveaway found for ' + messageID + ', please check and try again');
}).catch((err) => {
message.channel.send(`An error has occurred, please check and try again.\n\`${err}\``);
});
}

if (command === 'delete') {
const messageID = args[0];
client.giveawaysManager.delete(messageID).then(() => {
message.channel.send('Success! Giveaway deleted!');
}).catch(() => {
message.channel.send('No giveaway found for ' + messageID + ', please check and try again');
}).catch((err) => {
message.channel.send(`An error has occurred, please check and try again.\n\`${err}\``);
});
}

if (command === 'end') {
const messageID = args[0];
client.giveawaysManager.end(messageID).then(() => {
message.channel.send('Success! Giveaway ended!');
}).catch(() => {
message.channel.send('No giveaway found for ' + messageID + ', please check and try again');
}).catch((err) => {
message.channel.send(`An error has occurred, please check and try again.\n\`${err}\``);
});
}
});
Expand Down

0 comments on commit 67381fd

Please sign in to comment.