Skip to content

Commit

Permalink
🔀Merge pull request #1 from TF2Autobot/development
Browse files Browse the repository at this point in the history
🏷 v1.0.1
  • Loading branch information
idinium96 authored Jan 3, 2021
2 parents 4379a22 + 8ecb89b commit a309821
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 63 deletions.
142 changes: 84 additions & 58 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license": "MIT",
"dependencies": {
"death": "^1.1.0",
"discord-giveaways": "^4.4.0",
"discord-giveaways": "^4.4.2",
"discord.js": "^12.5.1",
"dotenv": "^8.2.0",
"ms": "^2.1.3",
Expand All @@ -24,10 +24,10 @@
"devDependencies": {
"@babel/preset-typescript": "^7.12.7",
"@types/death": "^1.1.1",
"@types/node": "^14.14.16",
"@typescript-eslint/eslint-plugin": "^4.11.0",
"@typescript-eslint/parser": "^4.11.0",
"eslint": "^7.16.0",
"@types/node": "^14.14.19",
"@typescript-eslint/eslint-plugin": "^4.11.1",
"@typescript-eslint/parser": "^4.11.1",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.0",
"eslint-plugin-tsdoc": "^0.2.10",
Expand Down
6 changes: 6 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ client.giveawaysManager.on('giveawayReactionRemoved', (giveaway, member, reactio
log.info(`${member.user.tag} unreact to giveaway #${giveaway.messageID} (${reaction.emoji.name})`);
});

client.giveawaysManager.on('giveawayEnded', (giveaway, winners) => {
log.info(
`Giveaway #${giveaway.messageID} ended! Winners: ${winners.map(member => member.user.username).join(', ')}`
);
});

fs.readdir(path.resolve(__dirname, 'events'), (_err, files) => {
files.forEach(file => {
if (!file.endsWith('.js')) return;
Expand Down
5 changes: 5 additions & 0 deletions src/commands/start-giveaway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ exports.run = async (client: ClientGiveaway, message: Message, args: string[]) =
return message.channel.send('❌ You have to specify a valid prize!');
}

if (giveawayPrize.length > 256) {
log.debug(`❌ ${message.author.toString()} specify a prize with more than 256 characters`);
return message.channel.send('❌ Prize(s) field should not exceed 256 characters!');
}

// Start the giveaway
void client.giveawaysManager.start(giveawayChannel, {
// The giveaway duration
Expand Down
2 changes: 2 additions & 0 deletions template.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
NODE_ENV="production"

BOT_TOKEN=""
PREFIX="g!"
UPDATE_COUNTDOWN_EVERY="5s"
Expand Down

0 comments on commit a309821

Please sign in to comment.