├── .gitignore ├── LICENSE ├── README.md ├── commands ├── Giveaways │ ├── end.js │ ├── reroll.js │ └── start.js └── Main │ └── help.js ├── config.json ├── events ├── client │ └── ready.js └── guild │ └── message.js ├── handlers ├── command.js └── event.js ├── index.js ├── package-lock.json ├── package.json ├── setup.bat └── start.bat /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | config.json -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 arktn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 | ⚠️ This repository does not work anymore! ⚠️ 5 | 6 |
7 |
8 |
9 | 🔨 Contributors 🔨 10 |

11 |
12 | Admins: 13 | 14 | 15 | 16 | 17 |
arktn
arktn

JacProsser
JacProsser

18 | Contributors: 19 | 20 | 21 | 22 | 23 | 24 |
OofChair
OofChair

Tanya575
Tanya575

GoudronViande24
GoudronViande24

25 |
26 |
27 | 28 | ## LICENSE 29 | MIT © 2023 [arktn](https://github.com/arktn) 30 | -------------------------------------------------------------------------------- /commands/Giveaways/end.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | config: { 3 | name: "end", 4 | description: "Ends a giveaway.", 5 | usage: "[message-id]", 6 | category: "Giveaways", 7 | accessableby: "Admins", 8 | aliases: [], // To add custom aliases just type ["alias1", "alias2"]. 9 | }, 10 | run: async (client, message, args) => { 11 | 12 | if (!message.member.hasPermission('MANAGE_MESSAGES') && !message.member.roles.cache.some((r) => r.name === "Giveaways")) { 13 | return message.channel.send(':boom: You need to have the \`MANAGE_MESSAGES\` permissions to end giveaways.'); 14 | } 15 | 16 | if (!args[0]) { 17 | return message.channel.send(':boom: Uh oh, I couldn\'t find that message! Try again!'); 18 | } 19 | 20 | let giveaway = 21 | client.giveawaysManager.giveaways.find((g) => g.prize === args.join(' ')) || 22 | client.giveawaysManager.giveaways.find((g) => g.messageID === args[0]); 23 | 24 | if (!giveaway) { 25 | return message.channel.send(':boom: Hm. I can\'t seem to find a giveaway for `' + args.join(' ') + '`.'); 26 | } 27 | client.giveawaysManager.edit(giveaway.messageID, { 28 | setEndTimestamp: Date.now() 29 | }) 30 | .then(() => { 31 | message.channel.send('Giveaway will end in less than ' + (client.giveawaysManager.options.updateCountdownEvery / 1000) + ' seconds...'); 32 | }) 33 | .catch((e) => { 34 | if (e.startsWith(`Giveaway with message ID ${giveaway.messageID} has already ended.`)) { 35 | 36 | message.channel.send('This giveaway has already ended!'); 37 | 38 | } else { 39 | console.error(e); 40 | message.channel.send('An error occurred...'); 41 | } 42 | }); 43 | }, 44 | } 45 | -------------------------------------------------------------------------------- /commands/Giveaways/reroll.js: -------------------------------------------------------------------------------- 1 | const ms = require('ms'); 2 | const config = require("../../config.json") 3 | module.exports = { 4 | config: { 5 | name: "reroll", 6 | description: "Rerolls a giveaway.", 7 | usage: "[message-id]", 8 | category: "Giveaways", 9 | accessableby: "Admins", 10 | aliases: [], // To add custom aliases just type ["alias1", "alias2"]. 11 | }, 12 | run: async (client, message, args) => { 13 | if (!message.member.hasPermission('MANAGE_MESSAGES') && !message.member.roles.cache.some((r) => r.name === "Giveaways")) { 14 | return message.channel.send(':boom: You need to have the \`MANAGE_MESSAGES\` permission to reroll giveaways.'); 15 | } 16 | 17 | if (!args[0]) { 18 | return message.channel.send(':boom: Uh oh, I couldn\'t find that message! Try again!'); 19 | } 20 | 21 | let giveaway = 22 | client.giveawaysManager.giveaways.find((g) => g.prize === args.join(' ')) || 23 | client.giveawaysManager.giveaways.find((g) => g.messageID === args[0]); 24 | 25 | if (!giveaway) { 26 | return message.channel.send(':boom: Hm. I can\'t seem to find a giveaway for `' + args.join(' ') + '`.'); 27 | } 28 | 29 | client.giveawaysManager.reroll(giveaway.messageID) 30 | .then(() => { 31 | message.channel.send('Giveaway rerolled!'); 32 | }) 33 | .catch((e) => { 34 | if (e.startsWith(`Giveaway with message ID ${giveaway.messageID} has not ended.`)) { 35 | message.channel.send('This giveaway has not ended!'); 36 | } else { 37 | console.error(e); 38 | message.channel.send('An error occurred...'); 39 | } 40 | }); 41 | }, 42 | } 43 | 44 | -------------------------------------------------------------------------------- /commands/Giveaways/start.js: -------------------------------------------------------------------------------- 1 | const ms = require('ms'); 2 | const config = require("../../config.json") 3 | 4 | module.exports = { 5 | config: { 6 | name: "start", 7 | description: "Starts a giveaway.", 8 | usage: "[channel] [duration] [winners] [prize]", 9 | category: "Giveaways", 10 | accessableby: "Admins", 11 | aliases: [], // To add custom aliases just type ["alias1", "alias2"]. 12 | }, 13 | run: async (client, message, args) => { 14 | if (config["Giveaway_Options"].giveawayManagerID) { 15 | if (!message.member.hasPermission('MANAGE_MESSAGES') && !message.member.roles.cache.some((r) => r.id === config["Giveaway_Options"].giveawayManagerID)) { 16 | return message.channel.send(':boom: You need to have the \`MANAGE_MESSAGES\` permissions to start giveaways.'); 17 | } 18 | } else { 19 | if (!message.member.hasPermission('MANAGE_MESSAGES') && !message.member.roles.cache.some((r) => r.name === "Giveaways")) { 20 | return message.channel.send(':boom: You need to have the \`MANAGE_MESSAGES\` permissions to start giveaways.'); 21 | } 22 | } 23 | 24 | let giveawayChannel = message.mentions.channels.first(); 25 | if (!giveawayChannel) { 26 | return message.channel.send(':boom: Uh oh, I couldn\'t find that channel! Try again!'); 27 | } 28 | 29 | let giveawayDuration = args[1]; 30 | if (!giveawayDuration || isNaN(ms(giveawayDuration))) { 31 | return message.channel.send(':boom: Hm. you haven\'t provided a duration. Can you try again?'); 32 | } 33 | 34 | let giveawayNumberWinners = args[2]; 35 | if (isNaN(giveawayNumberWinners) || (parseInt(giveawayNumberWinners) <= 0)) { 36 | return message.channel.send(':boom: Uh... you haven\'t provided the amount of winners.'); 37 | } 38 | 39 | let giveawayPrize = args.slice(3).join(' '); 40 | if (!giveawayPrize) { 41 | return message.channel.send(':boom: Oh, it seems like you didn\'t give me a valid prize!'); 42 | } 43 | if (!config["Giveaway_Options"].showMention && config["Giveaway_Options"].giveawayRoleID && config["Giveaway_Options"].giveawayMention) { 44 | 45 | giveawayChannel.send(`<@&${config["Giveaway_Options"].giveawayRoleID}>`).then((msg) => msg.delete({ timeout: 1000 })) 46 | client.giveawaysManager.start(giveawayChannel, { 47 | time: ms(giveawayDuration), 48 | prize: giveawayPrize, 49 | winnerCount: parseInt(giveawayNumberWinners), 50 | hostedBy: config["Giveaway_Options"].hostedBy ? message.author : null, 51 | messages: { 52 | giveaway: ":tada: **GIVEAWAY** :tada:", 53 | giveawayEnded: ":tada: **GIVEAWAY ENDED** :tada:", 54 | timeRemaining: "Time remaining: **{duration}**!", 55 | inviteToParticipate: "React with 🎉 to participate!", 56 | winMessage: "Congratulations, {winners}! You won the **{prize}**!", 57 | embedFooter: "Giveaways", 58 | noWinner: "Not enough entrants to determine a winner!", 59 | hostedBy: "Hosted by: {user}", 60 | winners: "winner(s)", 61 | endedAt: "Ended at", 62 | units: { 63 | seconds: "seconds", 64 | minutes: "minutes", 65 | hours: "hours", 66 | days: "days", 67 | pluralS: false 68 | } 69 | } 70 | }); 71 | 72 | } else if (config["Giveaway_Options"].showMention && config["Giveaway_Options"].giveawayRoleID && config["Giveaway_Options"].giveawayMention) { 73 | 74 | client.giveawaysManager.start(giveawayChannel, { 75 | time: ms(giveawayDuration), 76 | prize: giveawayPrize, 77 | winnerCount: parseInt(giveawayNumberWinners), 78 | hostedBy: config["Giveaway_Options"].hostedBy ? message.author : null, 79 | messages: { 80 | giveaway: (config["Giveaway_Options"].showMention ? `<@&${config["Giveaway_Options"].giveawayRoleID}>\n\n` : "") + ":tada: **GIVEAWAY** :tada:", 81 | giveawayEnded: (config["Giveaway_Options"].showMention ? `<@&${config["Giveaway_Options"].giveawayRoleID}>\n\n` : "") + ":tada: **GIVEAWAY ENDED** :tada:", 82 | timeRemaining: "Time remaining: **{duration}**!", 83 | inviteToParticipate: "React with 🎉 to participate!", 84 | winMessage: "Congratulations, {winners}! You won the **{prize}**!", 85 | embedFooter: "Giveaways", 86 | noWinner: "Not enough entrants to determine a winner!", 87 | hostedBy: "Hosted by: {user}", 88 | winners: "winner(s)", 89 | endedAt: "Ended at", 90 | units: { 91 | seconds: "seconds", 92 | minutes: "minutes", 93 | hours: "hours", 94 | days: "days", 95 | pluralS: false 96 | } 97 | } 98 | }); 99 | 100 | } else if (!config["Giveaway_Options"].showMention && !config["Giveaway_Options"].giveawayRoleID && config["Giveaway_Options"].giveawayMention) { 101 | giveawayChannel.send(`@everyone`).then((msg) => msg.delete({ timeout: 1000 })) 102 | client.giveawaysManager.start(giveawayChannel, { 103 | time: ms(giveawayDuration), 104 | prize: giveawayPrize, 105 | winnerCount: parseInt(giveawayNumberWinners), 106 | hostedBy: config["Giveaway_Options"].hostedBy ? message.author : null, 107 | messages: { 108 | giveaway: ":tada: **GIVEAWAY** :tada:", 109 | giveawayEnded: ":tada: **GIVEAWAY ENDED** :tada:", 110 | timeRemaining: "Time remaining: **{duration}**!", 111 | inviteToParticipate: "React with 🎉 to participate!", 112 | winMessage: "Congratulations, {winners}! You won the **{prize}**!", 113 | embedFooter: "Giveaways", 114 | noWinner: "Not enough entrants to determine a winner!", 115 | hostedBy: "Hosted by: {user}", 116 | winners: "winner(s)", 117 | endedAt: "Ended at", 118 | units: { 119 | seconds: "seconds", 120 | minutes: "minutes", 121 | hours: "hours", 122 | days: "days", 123 | pluralS: false 124 | } 125 | } 126 | }); 127 | 128 | } else if (config["Giveaway_Options"].showMention && !config["Giveaway_Options"].giveawayRoleID && config["Giveaway_Options"].giveawayMention) { 129 | client.giveawaysManager.start(giveawayChannel, { 130 | time: ms(giveawayDuration), 131 | prize: giveawayPrize, 132 | winnerCount: parseInt(giveawayNumberWinners), 133 | hostedBy: config["Giveaway_Options"].hostedBy ? message.author : null, 134 | messages: { 135 | giveaway: (config["Giveaway_Options"].showMention ? `@everyone\n\n` : "") + ":tada: **GIVEAWAY** :tada:", 136 | giveawayEnded: (config["Giveaway_Options"].showMention ? `@everyone\n\n` : "") + ":tada: **GIVEAWAY ENDED** :tada:", 137 | timeRemaining: "Time remaining: **{duration}**!", 138 | inviteToParticipate: "React with 🎉 to participate!", 139 | winMessage: "Congratulations, {winners}! You won the **{prize}**!", 140 | embedFooter: "Giveaways", 141 | noWinner: "Not enough entrants to determine a winner!", 142 | hostedBy: "Hosted by: {user}", 143 | winners: "winner(s)", 144 | endedAt: "Ended at", 145 | units: { 146 | seconds: "seconds", 147 | minutes: "minutes", 148 | hours: "hours", 149 | days: "days", 150 | pluralS: false 151 | } 152 | } 153 | }); 154 | } else if (!config["Giveaway_Options"].giveawayMention) { 155 | client.giveawaysManager.start(giveawayChannel, { 156 | time: ms(giveawayDuration), 157 | prize: giveawayPrize, 158 | winnerCount: parseInt(giveawayNumberWinners), 159 | hostedBy: config["Giveaway_Options"].hostedBy ? message.author : null, 160 | messages: { 161 | giveaway: ":tada: **GIVEAWAY** :tada:", 162 | giveawayEnded: ":tada: **GIVEAWAY ENDED** :tada:", 163 | timeRemaining: "Time remaining: **{duration}**!", 164 | inviteToParticipate: "React with 🎉 to participate!", 165 | winMessage: "Congratulations, {winners}! You won the **{prize}**!", 166 | embedFooter: "Giveaways", 167 | noWinner: "Not enough entrants to determine a winner!", 168 | hostedBy: "Hosted by: {user}", 169 | winners: "winner(s)", 170 | endedAt: "Ended at", 171 | units: { 172 | seconds: "seconds", 173 | minutes: "minutes", 174 | hours: "hours", 175 | days: "days", 176 | pluralS: false 177 | } 178 | } 179 | }); 180 | } 181 | 182 | 183 | message.channel.send(`:tada: Done! The giveaway for the \`${giveawayPrize}\` is starting in ${giveawayChannel}!`); 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /commands/Main/help.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../config.json") 3 | module.exports = { 4 | config: { 5 | name: "help", 6 | description: "Get a list of bot commands.", 7 | usage: "help", 8 | category: "Main", 9 | accessableby: "Everyone", 10 | aliases: [], // To add custom aliases just type ["alias1", "alias2"]. 11 | }, 12 | run: async (client, message, args) => { 13 | let avatarOptions = { 14 | format: 'png', 15 | dynamic: true, 16 | size: 1024 17 | } 18 | 19 | const embed = new MessageEmbed() 20 | .setAuthor( 21 | client.user.username, 22 | client.user.displayAvatarURL({ ...avatarOptions }), 23 | 'https://github.com/arktn/discord-giveaway-bot' 24 | ) 25 | .setThumbnail(client.user.displayAvatarURL({ ...avatarOptions })) 26 | .setTitle('Help') 27 | .setURL('https://github.com/arktn/discord-giveaway-bot') 28 | .setColor('7289da') 29 | .setDescription(`You want to create a giveaway bot yourself?\n[Check out our Github page!](https://github.com/arktn/discord-giveaway-bot)`) 30 | .addFields({ 31 | name: `🎉 ${config["Bot_Info"].prefix}start [channel] [duration] [winners] [prize]`, 32 | value: [ 33 | 'The channel has to be visible to the giveaway bot.', 34 | 'Duration is stated in a number and a time variable.', 35 | 'Winners is stated in a positive number.', 36 | 'Prize can be anything except blank.' 37 | ].join('\n') 38 | }, { 39 | name: '👥 Example:', 40 | value: [ 41 | `⌨️ ${config["Bot_Info"].prefix}start #general 10m 1 $9.99 Nitro`, 42 | `➡️ Creates a \`10 minute\` long giveaway with \`1\` winner and`, 43 | `\`$9.99 Nitro\` as a prize in \`#general\`.` 44 | ].join('\n') 45 | }, { 46 | name: `❌ ${config["Bot_Info"].prefix}end [message-id]`, 47 | value: 'Message-ID has to be the **ID** of the giveaway message.\n**Not the link!**' 48 | }, { 49 | name: '👥 Example:', 50 | value: `⌨️ ${config["Bot_Info"].prefix}end 892678258946659587\n➡️ Ends the giveaway with the message-ID \`892678258946659587\`.` 51 | }, { 52 | name: `🔍 ${config["Bot_Info"].prefix}reroll [message-id]`, 53 | value: 'Message-ID has to be the **ID** of the giveaway message.\n**Not the link!**' 54 | }, { 55 | name: '👥 Example:', 56 | value: `⌨️ ${config["Bot_Info"].prefix}reroll 892678258946659587\n➡️ Selects new winners for the giveaway with the message-ID \`892678258946659587\`.` 57 | }) 58 | .setFooter('Made with 💖 and discord.js by fez', client.user.displayAvatarURL({ ...avatarOptions })) 59 | 60 | if (message.guild) { 61 | message.channel.send('Check your DMs!'); 62 | message.delete(); 63 | message.author.send(embed); 64 | } else { 65 | message.author.send(embed) 66 | } 67 | }, 68 | }; 69 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "Bot_Info": { 3 | "token": "", 4 | "prefix": "" 5 | }, 6 | "Embed_Defaults": { 7 | "EmbedColour": "RANDOM" 8 | }, 9 | "Giveaway_Options": { 10 | "giveawayManagerID": "", 11 | "giveawayRoleID": "", 12 | "giveawayMention": true, 13 | "showMention": true, 14 | "hostedBy": true 15 | } 16 | } -------------------------------------------------------------------------------- /events/client/ready.js: -------------------------------------------------------------------------------- 1 | const config = require("../../config.json"); 2 | module.exports = async client => { 3 | 4 | console.log(`Bot: ${client.user.tag}\nChannels: ${client.channels.cache.size}\nServers: ${client.guilds.cache.size}\nUsers: ${client.users.cache.size}`); 5 | 6 | 7 | 8 | let statuses = [ 9 | `${config["Bot_Info"].prefix}start | ${config["Bot_Info"].prefix}help `, 10 | ] 11 | 12 | setInterval(function () { 13 | let status = statuses[Math.floor(Math.random() * statuses.length)]; 14 | 15 | client.user.setActivity(status, { type: 'PLAYING' }) 16 | }, 10000) 17 | } 18 | -------------------------------------------------------------------------------- /events/guild/message.js: -------------------------------------------------------------------------------- 1 | const config = require("../../config.json"); 2 | 3 | 4 | module.exports = async (client, message) => { 5 | if (message.author.bot || message.channel.type === "dm") return; 6 | 7 | let args = message.content.slice(config["Bot_Info"].prefix.length).trim().split(/ +/g); 8 | let cmd = args.shift().toLowerCase(); 9 | 10 | if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) return message.channel.send(`Try ${config["Bot_Info"].prefix}help to see a list of my commands.`) 11 | if (!message.content.startsWith(config["Bot_Info"].prefix)) return; 12 | let commandfile = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd)) 13 | if (commandfile) commandfile.run(client, message, args) 14 | } 15 | 16 | -------------------------------------------------------------------------------- /handlers/command.js: -------------------------------------------------------------------------------- 1 | const { readdirSync } = require("fs") 2 | 3 | module.exports = (client) => { 4 | const load = dirs => { 5 | const commands = readdirSync(`./commands/${dirs}/`).filter(d => d.endsWith('.js')); 6 | for (let file of commands) { 7 | let pull = require(`../commands/${dirs}/${file}`); 8 | client.commands.set(pull.config.name, pull); 9 | if (pull.config.aliases) pull.config.aliases.forEach(a => client.aliases.set(a, pull.config.name)); 10 | }; 11 | }; 12 | ["Main", "Giveaways"].forEach(x => load(x)); 13 | }; 14 | -------------------------------------------------------------------------------- /handlers/event.js: -------------------------------------------------------------------------------- 1 | const { readdirSync } = require("fs") 2 | 3 | module.exports = (client) => { 4 | const load = dirs => { 5 | const events = readdirSync(`./events/${dirs}/`).filter(d => d.endsWith('.js')); 6 | for (let file of events) { 7 | const evt = require(`../events/${dirs}/${file}`); 8 | let eName = file.split('.')[0]; 9 | client.on(eName, evt.bind(null, client)); 10 | }; 11 | }; 12 | ["client", "guild"].forEach(x => load(x)); 13 | }; -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const { Client, Collection } = require("discord.js"); 2 | const config = require("./config.json"); 3 | const client = new Client(); 4 | const { GiveawaysManager } = require('discord-giveaways'); 5 | 6 | client.giveawaysManager = new GiveawaysManager(client, { 7 | storage: "./giveaways.json", 8 | updateCountdownEvery: 5000, 9 | default: { 10 | botsCanWin: false, 11 | embedColor: "#FF0000", 12 | reaction: "🎉" 13 | } 14 | }); 15 | 16 | client.giveawaysManager.on("giveawayReactionAdded", (giveaway, member, reaction) => { 17 | console.log(`${member.user.tag} entered giveaway #${giveaway.messageID} (${reaction.emoji.name})`); 18 | }); 19 | 20 | client.giveawaysManager.on("giveawayReactionRemoved", (giveaway, member, reaction) => { 21 | console.log(`${member.user.tag} unreact to giveaway #${giveaway.messageID} (${reaction.emoji.name})`); 22 | }); 23 | 24 | client.giveawaysManager.on("giveawayEnded", (giveaway, winners) => { 25 | console.log(`Giveaway #${giveaway.messageID} ended! Winners: ${winners.map((member) => member.user.username).join(', ')}`); 26 | }); 27 | 28 | ["aliases", "commands"].forEach(x => client[x] = new Collection()); 29 | ["command", "event"].forEach(x => require(`./handlers/${x}`)(client)); 30 | 31 | 32 | client.login(config["Bot_Info"].token); 33 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord-giveaway-bot", 3 | "version": "2.2.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@discordjs/collection": { 8 | "version": "0.1.6", 9 | "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", 10 | "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" 11 | }, 12 | "@discordjs/form-data": { 13 | "version": "3.0.1", 14 | "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", 15 | "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", 16 | "requires": { 17 | "asynckit": "^0.4.0", 18 | "combined-stream": "^1.0.8", 19 | "mime-types": "^2.1.12" 20 | } 21 | }, 22 | "abort-controller": { 23 | "version": "3.0.0", 24 | "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", 25 | "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", 26 | "requires": { 27 | "event-target-shim": "^5.0.0" 28 | } 29 | }, 30 | "asynckit": { 31 | "version": "0.4.0", 32 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 33 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 34 | }, 35 | "combined-stream": { 36 | "version": "1.0.8", 37 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 38 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 39 | "requires": { 40 | "delayed-stream": "~1.0.0" 41 | } 42 | }, 43 | "deepmerge": { 44 | "version": "4.2.2", 45 | "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", 46 | "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" 47 | }, 48 | "delayed-stream": { 49 | "version": "1.0.0", 50 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 51 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 52 | }, 53 | "discord-giveaways": { 54 | "version": "4.4.3", 55 | "resolved": "https://registry.npmjs.org/discord-giveaways/-/discord-giveaways-4.4.3.tgz", 56 | "integrity": "sha512-/IgXWLA6p0bk348/xIrXsHeNQGZW5688fC6DTz5whC5hEAebjoY0usOSq/74iCQ99oQfIHsl6gx4j06UZcIc1w==", 57 | "requires": { 58 | "deepmerge": "^4.2.2" 59 | } 60 | }, 61 | "discord.js": { 62 | "version": "12.5.3", 63 | "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz", 64 | "integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==", 65 | "requires": { 66 | "@discordjs/collection": "^0.1.6", 67 | "@discordjs/form-data": "^3.0.1", 68 | "abort-controller": "^3.0.0", 69 | "node-fetch": "^2.6.1", 70 | "prism-media": "^1.2.9", 71 | "setimmediate": "^1.0.5", 72 | "tweetnacl": "^1.0.3", 73 | "ws": "^7.4.4" 74 | } 75 | }, 76 | "event-target-shim": { 77 | "version": "5.0.1", 78 | "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", 79 | "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" 80 | }, 81 | "mime-db": { 82 | "version": "1.47.0", 83 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", 84 | "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==" 85 | }, 86 | "mime-types": { 87 | "version": "2.1.30", 88 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", 89 | "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", 90 | "requires": { 91 | "mime-db": "1.47.0" 92 | } 93 | }, 94 | "ms": { 95 | "version": "2.1.3", 96 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 97 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 98 | }, 99 | "node-fetch": { 100 | "version": "2.6.7", 101 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", 102 | "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", 103 | "requires": { 104 | "whatwg-url": "^5.0.0" 105 | } 106 | }, 107 | "prism-media": { 108 | "version": "1.2.9", 109 | "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.9.tgz", 110 | "integrity": "sha512-UHCYuqHipbTR1ZsXr5eg4JUmHER8Ss4YEb9Azn+9zzJ7/jlTtD1h0lc4g6tNx3eMlB8Mp6bfll0LPMAV4R6r3Q==" 111 | }, 112 | "setimmediate": { 113 | "version": "1.0.5", 114 | "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", 115 | "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" 116 | }, 117 | "tr46": { 118 | "version": "0.0.3", 119 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 120 | "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" 121 | }, 122 | "tweetnacl": { 123 | "version": "1.0.3", 124 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", 125 | "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" 126 | }, 127 | "webidl-conversions": { 128 | "version": "3.0.1", 129 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 130 | "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" 131 | }, 132 | "whatwg-url": { 133 | "version": "5.0.0", 134 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", 135 | "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", 136 | "requires": { 137 | "tr46": "~0.0.3", 138 | "webidl-conversions": "^3.0.0" 139 | } 140 | }, 141 | "ws": { 142 | "version": "7.4.6", 143 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", 144 | "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==" 145 | } 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord-giveaway-bot", 3 | "version": "2.2.1", 4 | "description": "Very simple giveaway bot made with discord.js and discord-giveaways", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/arktn/discord-giveaway-bot" 12 | }, 13 | "author": "https://github.com/arktn", 14 | "license": "MIT", 15 | "dependencies": { 16 | "discord-giveaways": "^4.4.3", 17 | "discord.js": "^12.5.3", 18 | "ms": "^2.1.2" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo Installing/updating bot dependencies. 4 | call npm i --loglevel=warn >NUL 5 | echo. 6 | echo Done installing dependencies. Now run start.bat 7 | timeout 3 > nul 8 | 9 | if NOT ["%errorlevel%"]==["0"] ( 10 | pause 11 | exit /b %errorlevel% 12 | ) -------------------------------------------------------------------------------- /start.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | node index.js 3 | pause --------------------------------------------------------------------------------