Updated core files
This commit is contained in:
parent
f0db6ce4c0
commit
099c8edeed
3 changed files with 2249 additions and 58 deletions
76
index.js
76
index.js
|
@ -1,23 +1,21 @@
|
|||
process.title = 'Giveaway Child';
|
||||
const fs = require("fs");
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const Discord = require('discord.js');
|
||||
const Discord = require("discord.js");
|
||||
const client = new Discord.Client({
|
||||
intents: [
|
||||
Discord.Intents.FLAGS.GUILDS,
|
||||
Discord.Intents.FLAGS.GUILD_MEMBERS,
|
||||
Discord.Intents.FLAGS.GUILD_MESSAGE_REACTIONS
|
||||
]
|
||||
Discord.GatewayIntentBits.Guilds,
|
||||
Discord.GatewayIntentBits.GuildMembers,
|
||||
Discord.GatewayIntentBits.GuildMessageReactions,
|
||||
],
|
||||
});
|
||||
|
||||
const config = require('./config.json');
|
||||
const config = require("./config.json");
|
||||
client.config = config;
|
||||
|
||||
const synchronizeSlashCommands = require('discord-sync-commands');
|
||||
const synchronizeSlashCommands = require("discord-sync-commands");
|
||||
|
||||
// Init discord giveaways
|
||||
const { GiveawaysManager } = require('discord-giveaways');
|
||||
const { GiveawaysManager } = require("discord-giveaways");
|
||||
client.giveawaysManager = new GiveawaysManager(client, {
|
||||
storage: "./giveaways.json",
|
||||
default: {
|
||||
|
@ -26,24 +24,38 @@ client.giveawaysManager = new GiveawaysManager(client, {
|
|||
reaction: "🎉",
|
||||
lastChance: {
|
||||
enabled: true,
|
||||
content: '⚠️ **LAST CHANCE TO ENTER !** ⚠️',
|
||||
threshold: 5000,
|
||||
embedColor: '#FF0000'
|
||||
}
|
||||
}
|
||||
content: "⚠️ **LAST CHANCE TO ENTER !** ⚠️",
|
||||
threshold: 10000,
|
||||
embedColor: "#FF0000",
|
||||
},
|
||||
},
|
||||
});
|
||||
// We now have a client.giveawaysManager property to manage our giveaways!
|
||||
// We not have a client.giveaways property to manage our giveaways
|
||||
|
||||
client.giveawaysManager.on("giveawayReactionAdded", (giveaway, member, reaction) => {
|
||||
console.log(`${member.user.tag} entered giveaway #${giveaway.messageId} (${reaction.emoji.name})`);
|
||||
});
|
||||
client.giveawaysManager.on(
|
||||
"giveawayReactionAdded",
|
||||
(giveaway, member, reaction) => {
|
||||
console.log(
|
||||
`${member.user.tag} entered giveaway #${giveaway.messageId} (${reaction.emoji.name})`
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
client.giveawaysManager.on("giveawayReactionRemoved", (giveaway, member, reaction) => {
|
||||
console.log(`${member.user.tag} unreact to giveaway #${giveaway.messageId} (${reaction.emoji.name})`);
|
||||
});
|
||||
client.giveawaysManager.on(
|
||||
"giveawayReactionRemoved",
|
||||
(giveaway, member, reaction) => {
|
||||
console.log(
|
||||
`${member.user.tag} unreact to giveaway #${giveaway.messageId} (${reaction.emoji.name})`
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
client.giveawaysManager.on("giveawayEnded", (giveaway, winners) => {
|
||||
console.log(`Giveaway #${giveaway.messageId} ended! Winners: ${winners.map((member) => member.user.username).join(', ')}`);
|
||||
console.log(
|
||||
`Giveaway #${giveaway.messageId} ended! Winners: ${winners
|
||||
.map((member) => member.user.username)
|
||||
.join(", ")}`
|
||||
);
|
||||
});
|
||||
|
||||
/* Load all commands */
|
||||
|
@ -55,18 +67,22 @@ fs.readdir("./commands/", (_err, files) => {
|
|||
let commandName = file.split(".")[0];
|
||||
client.commands.set(commandName, {
|
||||
name: commandName,
|
||||
...props
|
||||
...props,
|
||||
});
|
||||
console.log(`👌 Command loaded: ${commandName}`);
|
||||
});
|
||||
synchronizeSlashCommands(client, client.commands.map((c) => ({
|
||||
synchronizeSlashCommands(
|
||||
client,
|
||||
client.commands.map((c) => ({
|
||||
name: c.name,
|
||||
description: c.description,
|
||||
options: c.options,
|
||||
type: 'CHAT_INPUT'
|
||||
})), {
|
||||
debug: true
|
||||
});
|
||||
type: Discord.ApplicationCommandType.ChatInput,
|
||||
})),
|
||||
{
|
||||
debug: true,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
/* Load all events */
|
||||
|
|
2175
package-lock.json
generated
Normal file
2175
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -22,9 +22,9 @@
|
|||
"homepage": "https://github.com/EmotionChild/Giveaway-Child#readme",
|
||||
"dependencies": {
|
||||
"beautify": "0.0.8",
|
||||
"discord-giveaways": "^5.0.1",
|
||||
"discord-giveaways": "^6.0.1",
|
||||
"discord-sync-commands": "0.3.0",
|
||||
"discord.js": "^13.9.0",
|
||||
"discord.js": "^14.6.0",
|
||||
"fero-ms": "^2.0.7",
|
||||
"ms": "^2.1.3",
|
||||
"quickdb": "1.0.5",
|
||||
|
|
Loading…
Reference in a new issue