Giftix | Event Handler
Installation
npm install giftix --save
yarn add giftix
const Giftix = require("giftix");
const giftixClient = new Giftix({
guild: "911264853086318702",
intents: [
"BOOST",
"UNBOOST",
"GIVEAWAY_JOIN",
"GIVEAWAY_FINISH",
"GIVEAWAY_REROLL",
"GIVEAWAY_CREATE",
]
});
giftixClient.on("ready", () => {
console.log("Connected to Giftix, listening events...");
});
giftixClient.on("boost", ({ user }) => {
console.log(`${user.username} boosted our server!`);
});
giftixClient.on("unboost", ({ user }) => {
console.log(`${user.username} remove the boost from server. :(`);
});
giftixClient.on("giveawayJoin", ({ user, giveaway }) => {
console.log(`${user.username} joined the ${giveaway.title} giveaway.`);
});
giftixClient.on("giveawayFinish", ({ giveaway, winners }) => {
console.log(`${giveaway.title} has been ended. Winners: ${winners.map(_w => _w.id).join(",")}`);
});
giftixClient.on("giveawayReroll", ({ giveaway, winners }) => {
console.log(`${giveaway.title} has been rerolled. New Winners: ${winners.map(_w => _w.id).join(",")}`);
});
giftixClient.on("giveawayDelete", ({ giveaway }) => {
console.log(`${giveaway.title} has been deleted.`);
});