{"version":3,"sources":["../../src/register.ts"],"names":[],"mappings":";;;;;AAAA,SAAS,QAAQ,gBAAgB,WAAW,oBAAoB,WAAW,iCAAiC;AAE5G,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAMvB,IAAM,kBAAN,MAAM,wBAAuB,OAAO;AAAA,EAC1C,QAAe,yBAAyB,IAA8B;AACrE,cAAU,WAAW,IAAI,SAAS,KAAK,QAAQ,QAAQ;AAAA,EACxD;AAAA,EAEA,QAAe,kBAAkB,IAA8B;AAC9D,kBAAc;AAAA,EACf;AAAA,EAEA,QAAe,SAAS,IAA8B;AACrD,QAAI,KAAK,QAAQ,UAAU,KAAK;AAC/B,gBAAU,OAAO,KAAK,iEAAiE;AAAA,IACxF;AAEA,SAAK,KAAK,QAAQ,UAAU,YAAY,SAAS,KAAK,QAAQ,UAAU,KAAK;AAC5E,gBAAU,OAAO,KAAK,gEAAgE;AACtF,kBAAY,YAAY,UAAU,SAAS,UAAU,GAAG,GAAM;AAAA,IAC/D;AAEA,QAAI,KAAK,SAAS,KAAK,SAAS,UAAU,YAAY,KAAK,QAAQ,UAAU,KAAK;AACjF,gBAAU,OAAO,KAAK,0CAA0C;AAAA,IACjE;AAAA,EACD;AACD;AAvB2C;AAApC,IAAM,iBAAN;AAyBP,eAAe,QAAQ,sCAAsC,eAAe,yBAAyB,GAAG,oCAAoC;AAC5I,eAAe,QAAQ,+BAA+B,eAAe,kBAAkB,GAAG,6BAA6B;AACvH,eAAe,QAAQ,sBAAsB,eAAe,SAAS,GAAG,oBAAoB","sourcesContent":["import { Plugin, SapphireClient, container, postInitialization, postLogin, preGenericsInitialization } from '@sapphire/framework';\n\nimport { Statcord } from './index';\nimport { loadListeners } from './listeners/_load';\n\n/**\n * Plugin allowing Out of the box Statcord integration with @sapphire/framework.\n * @since 1.0.0\n */\nexport class StatcordPlugin extends Plugin {\n\tpublic static [preGenericsInitialization](this: SapphireClient): void {\n\t\tcontainer.statcord = new Statcord(this.options.statcord);\n\t}\n\n\tpublic static [postInitialization](this: SapphireClient): void {\n\t\tloadListeners();\n\t}\n\n\tpublic static [postLogin](this: SapphireClient): void {\n\t\tif (this.options.statcord?.key) {\n\t\t\tcontainer.logger.info('[Statcord-Plugin]: Enabled. Synchronizing states with Statcord.');\n\t\t}\n\n\t\tif ((this.options.statcord?.autopost ?? true) && this.options.statcord?.key) {\n\t\t\tcontainer.logger.info('[Statcord-Plugin]: Auto-posting of statistics has been enabled');\n\t\t\tsetInterval(async () => container.statcord.postStats(), 60_000);\n\t\t}\n\n\t\tif (this.shard && this.options?.statcord?.sharding && this.options.statcord?.key) {\n\t\t\tcontainer.logger.info('[Statcord-Plugin]: Sharding mode enabled');\n\t\t}\n\t}\n}\n\nSapphireClient.plugins.registerPreGenericsInitializationHook(StatcordPlugin[preGenericsInitialization], 'Statcord-PreGenericsInitialization');\nSapphireClient.plugins.registerPostInitializationHook(StatcordPlugin[postInitialization], 'Statcord-PostInitialization');\nSapphireClient.plugins.registerPostLoginHook(StatcordPlugin[postLogin], 'Statcord-PostLogin');\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\t/**\n\t\t * @deprecated Statcord and all related discordlabs have been discontinued. This plugin will be discontinued soon.\n\t\t */\n\t\tstatcord: Statcord;\n\t}\n}\n"]}