From 4272ae63b0d362c07f9ffe58c55ae350a87f604b Mon Sep 17 00:00:00 2001 From: Slincnik Date: Thu, 16 Jan 2025 17:38:30 +0300 Subject: [PATCH] feat: added support to giveaways manager --- src/structures/client.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/structures/client.ts b/src/structures/client.ts index e9eef352..9da75207 100644 --- a/src/structures/client.ts +++ b/src/structures/client.ts @@ -1,4 +1,5 @@ import { Client, ClientOptions } from "discord.js"; +import { GiveawaysManager } from "discord-giveaways"; import { TOptionsBase } from "i18next"; import { Handlers } from "@/handlers/index.js"; import MongooseAdapter from "@/adapters/database/MongooseAdapter.js"; @@ -23,6 +24,17 @@ export class ExtendedClient extends Client { }, ) => string; + // @ts-ignore - because ExtendedClient != Client from discord.js + giveaways = new GiveawaysManager(this, { + storage: "../../giveaways.json", + default: { + botsCanWin: false, + embedColor: this.configService.get("embed.color"), + embedColorEnd: "#FF0000", + reaction: "🎉", + }, + }); + constructor(options: ClientOptions) { if (SUPER_CONTEXT.getStore()) { return SUPER_CONTEXT.getStore() as ExtendedClient;