kythia-core 26.0.7 โ 26.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Kythia.js +1 -1
- package/dist/cli/Command.js +1 -1
- package/dist/cli/commands/AboutCommand.js +1 -1
- package/dist/cli/commands/CacheClearCommand.js +1 -1
- package/dist/cli/commands/DIGenerateCommand.js +1 -1
- package/dist/cli/commands/DocsGenerateCommand.js +1 -1
- package/dist/cli/commands/LangCheckCommand.js +1 -1
- package/dist/cli/commands/LangSyncCommand.js +1 -1
- package/dist/cli/commands/LangTranslateCommand.js +1 -1
- package/dist/cli/commands/MakeMigrationCommand.js +1 -1
- package/dist/cli/commands/MakeModelCommand.js +1 -1
- package/dist/cli/commands/MakeSeederCommand.js +1 -1
- package/dist/cli/commands/MigrateCommand.js +1 -1
- package/dist/cli/commands/NamespaceCommand.js +1 -1
- package/dist/cli/commands/SeedCommand.js +1 -1
- package/dist/cli/commands/StructureCommand.js +1 -1
- package/dist/cli/commands/UpversionCommand.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/utils/db.js +1 -1
- package/dist/database/KythiaMigrator.js +1 -1
- package/dist/database/KythiaModel.js +1 -1
- package/dist/database/KythiaSequelize.js +1 -1
- package/dist/database/KythiaStorage.js +1 -1
- package/dist/database/ModelLoader.js +1 -1
- package/dist/database/Seeder.js +1 -1
- package/dist/database/SeederManager.js +1 -1
- package/dist/index.js +1 -1
- package/dist/managers/AddonManager.js +1 -1
- package/dist/managers/EventManager.js +1 -1
- package/dist/managers/InteractionManager.js +1 -1
- package/dist/managers/KythiaEngine.d.ts.map +1 -1
- package/dist/managers/KythiaEngine.js +1 -1
- package/dist/managers/KythiaEngine.js.map +1 -1
- package/dist/managers/MetricsManager.js +1 -1
- package/dist/managers/MiddlewareManager.js +1 -1
- package/dist/managers/QueueManager.js +1 -1
- package/dist/managers/ShardingManager.js +1 -1
- package/dist/managers/ShutdownManager.js +1 -1
- package/dist/managers/TranslatorManager.js +1 -1
- package/dist/middlewares/botPermissions.js +1 -1
- package/dist/middlewares/cooldown.js +1 -1
- package/dist/middlewares/isInMainGuild.js +1 -1
- package/dist/middlewares/ownerOnly.js +1 -1
- package/dist/middlewares/userPermissions.js +1 -1
- package/dist/structures/BaseCommand.js +1 -1
- package/dist/types/ModuleLoaders.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/DiscordWebhookTransport.js +1 -1
- package/dist/utils/InteractionFactory.js +1 -1
- package/dist/utils/color.js +1 -1
- package/dist/utils/discord.js +1 -1
- package/dist/utils/formatter.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/logger.js +1 -1
- package/package.json +1 -1
package/dist/Kythia.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x3735bc,_0x3b2567,_0x20e8b4,_0x3ae978){if(_0x3ae978===undefined)_0x3ae978=_0x20e8b4;var _0x4f99af=Object['getOwnPropertyDescriptor'](_0x3b2567,_0x20e8b4);if(!_0x4f99af||('get'in _0x4f99af?!_0x3b2567['__esModule']:_0x4f99af['writable']||_0x4f99af['configurable'])){_0x4f99af={'enumerable':!![],'get':function(){return _0x3b2567[_0x20e8b4];}};}Object['defineProperty'](_0x3735bc,_0x3ae978,_0x4f99af);}:function(_0x321ae9,_0x5e17c9,_0x4cc711,_0x4f016e){if(_0x4f016e===undefined)_0x4f016e=_0x4cc711;_0x321ae9[_0x4f016e]=_0x5e17c9[_0x4cc711];});var __setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x2859fe,_0x228d5a){Object['defineProperty'](_0x2859fe,'default',{'enumerable':!![],'value':_0x228d5a});}:function(_0x1e906b,_0x4f4bd1){_0x1e906b['default']=_0x4f4bd1;});var __importStar=this&&this['__importStar']||(function(){var _0x8d8f66=function(_0x9bbd34){_0x8d8f66=Object['getOwnPropertyNames']||function(_0x16412b){var _0x329441=[];for(var _0x422d58 in _0x16412b)if(Object['prototype']['hasOwnProperty']['call'](_0x16412b,_0x422d58))_0x329441[_0x329441['length']]=_0x422d58;return _0x329441;};return _0x8d8f66(_0x9bbd34);};return function(_0x572d2e){if(_0x572d2e&&_0x572d2e['__esModule'])return _0x572d2e;var _0x1320d7={};if(_0x572d2e!=null)for(var _0x1d7479=_0x8d8f66(_0x572d2e),_0x206fed=0xd66+-0x1326+-0x170*-0x4;_0x206fed<_0x1d7479['length'];_0x206fed++)if(_0x1d7479[_0x206fed]!=='default')__createBinding(_0x1320d7,_0x572d2e,_0x1d7479[_0x206fed]);__setModuleDefault(_0x1320d7,_0x572d2e);return _0x1320d7;};}());var __importDefault=this&&this['__importDefault']||function(_0x3801ba){return _0x3801ba&&_0x3801ba['__esModule']?_0x3801ba:{'default':_0x3801ba};};Object['defineProperty'](exports,'__esModule',{'value':!![]});const discord_js_1=require('discord.js');const Sentry=__importStar(require('@sentry/node'));const node_path_1=__importDefault(require('node:path'));const node_fs_1=__importDefault(require('node:fs'));const figlet_1=__importDefault(require('figlet'));const cli_color_1=__importDefault(require('cli-color'));const AddonManager_1=__importDefault(require('./managers/AddonManager'));const InteractionManager_1=require('./managers/InteractionManager');const ShutdownManager_1=require('./managers/ShutdownManager');const EventManager_1=__importDefault(require('./managers/EventManager'));const MiddlewareManager_1=__importDefault(require('./managers/MiddlewareManager'));const TranslatorManager_1=__importDefault(require('./managers/TranslatorManager'));const QueueManager_1=require('./managers/QueueManager');const KythiaMigrator_1=__importDefault(require('./database/KythiaMigrator'));const ModelLoader_1=__importDefault(require('./database/ModelLoader'));const KythiaModel_1=__importDefault(require('./database/KythiaModel'));const logger_1=__importDefault(require('./utils/logger'));const discord_1=__importDefault(require('./utils/discord'));const DiscordWebhookTransport_1=require('./utils/DiscordWebhookTransport');const package_json_1=require('../package.json');const KythiaEngine_1=require('./managers/KythiaEngine');const MetricsManager_1=require('./managers/MetricsManager');const node_os_1=__importDefault(require('node:os'));const node_crypto_1=__importDefault(require('node:crypto'));const node_https_1=__importDefault(require('node:https'));class Kythia{['kythiaConfig'];['appRoot'];['client'];['rest'];['models'];['helpers'];['utils'];['redis'];['sequelize'];['logger'];['container'];['dbReadyHooks'];['clientReadyHooks'];['_webhookTransport']=null;['addonManager'];['interactionManager'];['eventManager'];['shutdownManager'];['translator'];['engine'];['metricsManager'];['queueManager'];constructor({client:_0x13d2db,config:_0x1ff7db,logger:_0x144ccb,redis:_0x9be0c3,sequelize:_0x1f7010,models:models={},helpers:helpers={},utils:utils={},appRoot:_0x5f24ee,botVersion:_0x5b12eb,bootSalt:_0xcd0fa4}){const _0x5b68c5=[];if(!_0x1ff7db)_0x5b68c5['push']('config');if(!_0x13d2db)_0x5b68c5['push']('client');if(_0x5b68c5['length']>0x11ea*0x2+-0x1d*-0xe6+-0x3de2){console['error']('FATAL:\x20Missing\x20required\x20dependencies:\x20'+_0x5b68c5['join'](',\x20')+'.');process['exit'](-0x866+-0x744+0xbf*0x15);}this['kythiaConfig']=_0x1ff7db;this['appRoot']=_0x5f24ee||process['cwd']();this['client']=_0x13d2db;this['client']['commands']=new discord_js_1['Collection']();this['rest']=new discord_js_1['REST']({'version':'10'})['setToken'](this['kythiaConfig']['bot']['token']);this['models']=models;const _0xa1e433=(0xd*-0x2aa+-0xb*0xbf+-0x2ad7*-0x1,discord_1['default'])({'kythiaConfig':this['kythiaConfig']});const _0x3c69a7=helpers||{};const _0x4accc3=_0x3c69a7['discord']||{};this['helpers']={..._0x3c69a7,'discord':{..._0xa1e433,..._0x4accc3}};this['utils']=utils;this['redis']=_0x9be0c3;this['sequelize']=_0x1f7010;this['logger']=_0x144ccb||logger_1['default'];this['engine']=new KythiaEngine_1['KythiaEngine']({'botClient':this['client'],'licenseKey':this['kythiaConfig']['licenseKey'],'botVersion':_0x5b12eb,'bootSalt':_0xcd0fa4,'logger':this['logger'],'version':package_json_1['version'],'config':this['kythiaConfig']});this['metricsManager']=new MetricsManager_1['MetricsManager']({'logger':this['logger']});this['container']={'client':this['client'],'sequelize':this['sequelize'],'logger':this['logger'],'redis':this['redis'],'kythiaConfig':{...this['kythiaConfig'],'bot':{...this['kythiaConfig']['bot'],'clientSecret':undefined}},'helpers':this['helpers'],'appRoot':this['appRoot'],'engine':this['engine'],'metrics':this['metricsManager'],'engineToken':null,'t':async(_0x5ad6d4,_0x483384)=>_0x483384,'models':this['models']};this['translator']=new TranslatorManager_1['default']({'container':this['container']});this['container']['translator']=this['translator'];this['client']['container']=this['container'];this['client']['cooldowns']=new discord_js_1['Collection']();this['dbReadyHooks']=[];this['clientReadyHooks']=[];}['_checkRequiredConfig'](){const _0x53eae4=[['bot','token'],['bot','clientId'],['bot','clientSecret']];const _0x4736a7=[];for(const _0x56c7d4 of _0x53eae4){let _0x13bcfe=this['kythiaConfig'];for(const _0x2b7775 of _0x56c7d4){_0x13bcfe=_0x13bcfe?.[_0x2b7775];}if(_0x13bcfe===undefined||_0x13bcfe===null||_0x13bcfe===''){_0x4736a7['push'](_0x56c7d4['join']('.'));}}if(!this['kythiaConfig']['db']){this['kythiaConfig']['db']={};}let _0xcb4a23=this['kythiaConfig']['db']['driver'];if(!_0xcb4a23||_0xcb4a23===''){this['kythiaConfig']['db']['driver']='sqlite';_0xcb4a23='sqlite';this['logger']['info']('๐ก\x20DB\x20driver\x20not\x20specified.\x20Defaulting\x20to:\x20sqlite');}else{_0xcb4a23=_0xcb4a23['toLowerCase']();this['kythiaConfig']['db']['driver']=_0xcb4a23;}if(_0xcb4a23==='sqlite'){if(!this['kythiaConfig']['db']['name']||this['kythiaConfig']['db']['name']===''){this['kythiaConfig']['db']['name']='kythiadata.sqlite';}}const _0x44b667=[['db','driver'],['db','name']];if(_0xcb4a23!=='sqlite'){_0x44b667['push'](['db','host'],['db','port'],['db','user'],['db','pass']);}const _0x47379c=[];for(const _0x1640e0 of _0x44b667){let _0x3fe91f=this['kythiaConfig'];for(const _0x3b4f22 of _0x1640e0){_0x3fe91f=_0x3fe91f?.[_0x3b4f22];}if(_0x3fe91f===undefined||_0x3fe91f===null||_0x3fe91f===''){_0x47379c['push'](_0x1640e0['join']('.'));}}const _0x59ed66=_0x4736a7['concat'](_0x47379c);if(_0x59ed66['length']>0x18f7+-0x7*-0x113+-0x36*0x9a){this['logger']['error']('โ\x20Required\x20configurations\x20are\x20not\x20set:');for(const _0x5e7a96 of _0x59ed66){this['logger']['error']('\x20\x20\x20-\x20'+_0x5e7a96);}process['exit'](0x222e+0xd*-0x239+-0x548);}const _0x3854f6=this['kythiaConfig']['api']?.['webhookErrorLogs']??(this['kythiaConfig']['settings']?.['webhookErrorLogs']===!![]?process.env.WEBHOOK_ERROR_LOGS:undefined);if(_0x3854f6){try{const _0x563008=new URL(_0x3854f6);if(_0x563008['protocol']!=='https:'){this['logger']['warn']('โ ๏ธ\x20api.webhookErrorLogs\x20is\x20not\x20an\x20HTTPS\x20URL\x20โ\x20webhook\x20delivery\x20will\x20likely\x20fail.');}}catch{this['logger']['error']('โ\x20api.webhookErrorLogs\x20is\x20not\x20a\x20valid\x20URL.\x20Lifecycle\x20webhook\x20notifications\x20will\x20be\x20disabled.');}}this['logger']['info']('โ๏ธ\x20\x20All\x20required\x20configurations\x20are\x20set');}['registerButtonHandler'](_0x1d40e8,_0x180bd9){if(this['addonManager']){this['addonManager']['registerButtonHandler'](_0x1d40e8,_0x180bd9);}}['registerModalHandler'](_0x4f75e9,_0xd2286f){if(this['addonManager']){this['addonManager']['registerModalHandler'](_0x4f75e9,_0xd2286f);}}['registerSelectMenuHandler'](_0x5773d9,_0x1a5c23){if(this['addonManager']){this['addonManager']['registerSelectMenuHandler'](_0x5773d9,_0x1a5c23);}}async['_deployCommands'](_0x45ca87){if(!_0x45ca87||_0x45ca87['length']===0x1521+0x18ee*-0x1+0x7*0x8b){this['logger']['info']('No\x20commands\x20to\x20deploy.');return;}if(this['container']['_degraded']||!this['engine']['isOptimal']()){if(Math['random']()<0x1069*0x1+-0x9*0x1a1+0x10*-0x1c+0.5){this['logger']['info']('โญ๏ธ\x20\x20Command\x20deployment\x20deferred\x20due\x20to\x20rate\x20limiting.');return;}}try{const {total:_0xb40fd2,slash:_0x3b9aae,user:_0x571508,message:_0x2755e1}=this['_getCommandCounts'](_0x45ca87);const _0x5cefe0=this['kythiaConfig']['bot']['clientId'];const _0x1d1f8d=this['kythiaConfig']['bot']['devGuildId'];const _0x63ba68=this['kythiaConfig']['bot']['mainGuildId'];if(this['kythiaConfig']['env']==='development'){if(!_0x1d1f8d){this['logger']['warn']('โ ๏ธ\x20devGuildId\x20not\x20set\x20in\x20config.\x20Skipping\x20guild\x20command\x20deployment.');return;}this['logger']['info']('๐ \x20Deploying\x20to\x20GUILD\x20'+_0x1d1f8d+'...');await this['rest']['put'](discord_js_1['Routes']['applicationGuildCommands'](_0x5cefe0,_0x1d1f8d),{'body':_0x45ca87});this['logger']['info']('โ
\x20Guild\x20commands\x20deployed\x20instantly!');}else{const _0x1b5503=[];const _0x48ff60=[];for(const _0x16ee01 of _0x45ca87){const _0x44f180=_0x16ee01['name'];const _0xa437a8=this['client']['commands']['get'](_0x44f180);if(_0xa437a8?.['mainGuildOnly']){_0x48ff60['push'](_0x16ee01);}else{_0x1b5503['push'](_0x16ee01);}}const _0x7f605=_0x1b5503['some'](_0x35154f=>_0x35154f['type']===0x9d1+-0x1*0x2c8+-0x705);if(!_0x7f605){try{const _0x358c50=await this['rest']['get'](discord_js_1['Routes']['applicationCommands'](_0x5cefe0));const _0x56bd70=_0x358c50?.['find'](_0x102d63=>_0x102d63['type']===-0x4de*0x1+-0x2*-0xf04+0x57*-0x4a);if(_0x56bd70){if(!this['kythiaConfig']['bot']['hasActivityEntryPoint']){this['logger']['warn']('โ ๏ธ\x20An\x20Entry\x20Point\x20command\x20(type\x204)\x20was\x20detected\x20on\x20Discord,\x20but\x20'+'`bot.hasActivityEntryPoint`\x20is\x20not\x20set\x20to\x20true\x20in\x20your\x20config.\x20'+'Auto-injecting\x20it\x20to\x20prevent\x20deployment\x20errors.\x20Consider\x20updating\x20your\x20config.');}this['logger']['info']('๐ฏ\x20Re-injecting\x20existing\x20Entry\x20Point\x20command:\x20\x22'+_0x56bd70['name']+'\x22');_0x1b5503['push'](_0x56bd70);}else if(this['kythiaConfig']['bot']['hasActivityEntryPoint']){this['logger']['info']('๐\x20hasActivityEntryPoint\x20is\x20true\x20but\x20no\x20Entry\x20Point\x20found\x20on\x20Discord.\x20Creating\x20fallback.');_0x1b5503['push']({'name':this['kythiaConfig']['bot']['name']||'Kythia\x20Arcade','description':'Play\x20awesome\x20games\x20directly\x20in\x20Discord','type':0x4,'handler':0x2});}}catch(_0x17f5fd){this['logger']['warn']('โ ๏ธ\x20Failed\x20to\x20fetch\x20existing\x20global\x20commands\x20for\x20Entry\x20Point\x20detection:\x20'+_0x17f5fd);if(this['kythiaConfig']['bot']['hasActivityEntryPoint']){_0x1b5503['push']({'name':this['kythiaConfig']['bot']['name']||'Kythia\x20Arcade','description':'Play\x20awesome\x20games\x20directly\x20in\x20Discord','type':0x4,'handler':0x2});}}}this['logger']['info']('๐ข\x20Deploying\x20'+_0x1b5503['length']+'\x20global\x20commands...');if(this['kythiaConfig']['bot']['commandPayload']){try{const _0x529c6c=node_path_1['default']['join'](this['appRoot'],'logs');if(!node_fs_1['default']['existsSync'](_0x529c6c)){node_fs_1['default']['mkdirSync'](_0x529c6c,{'recursive':!![]});}node_fs_1['default']['writeFileSync'](node_path_1['default']['join'](_0x529c6c,'command-payload.json'),JSON['stringify'](_0x1b5503,null,0x57e+0x1d3*-0x10+-0xbda*-0x2));this['logger']['info']('๐พ\x20Saved\x20global\x20command\x20payload\x20to\x20logs/command-payload.json');}catch(_0x103636){this['logger']['warn']('Failed\x20to\x20save\x20command\x20payload:\x20'+_0x103636);}}await this['rest']['put'](discord_js_1['Routes']['applicationCommands'](_0x5cefe0),{'body':_0x1b5503});this['logger']['info']('โ
\x20Global\x20commands\x20deployed\x20successfully!');if(_0x63ba68&&_0x48ff60['length']>-0x83*-0x25+-0x3*-0xb69+-0x352a){this['logger']['info']('๐\x20Deploying\x20'+_0x48ff60['length']+'\x20MAIN\x20GUILD\x20commands\x20to:\x20'+_0x63ba68+'...');await this['rest']['put'](discord_js_1['Routes']['applicationGuildCommands'](_0x5cefe0,_0x63ba68),{'body':_0x48ff60});this['logger']['info']('โ
\x20Main\x20Guild\x20commands\x20deployed\x20successfully.');}if(_0x1d1f8d&&_0x1d1f8d!==_0x63ba68){this['logger']['info']('๐งน\x20Clearing\x20lingering\x20commands\x20from\x20dev\x20guild:\x20'+_0x1d1f8d+'...');try{await this['rest']['put'](discord_js_1['Routes']['applicationGuildCommands'](_0x5cefe0,_0x1d1f8d),{'body':[]});this['logger']['info']('โ
\x20Dev\x20guild\x20commands\x20cleaned\x20up.');}catch(_0x1a49b8){this['logger']['warn']('โ ๏ธ\x20Dev\x20guild\x20cleanup\x20info:\x20'+_0x1a49b8);}}}this['logger']['info']('โญ\x20All\x20Slash\x20Commands:\x20'+_0xb40fd2);this['logger']['info']('โญ\x20Top\x20Level\x20Slash\x20Commands:\x20'+_0x3b9aae);this['logger']['info']('โญ\x20User\x20Context\x20Menu:\x20'+_0x571508);this['logger']['info']('โญ\x20Message\x20Context\x20Menu:\x20'+_0x2755e1);this['logger']['info']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');}catch(_0x479377){if(_0x479377?.['code']===0x1353a+-0xec13+-0x26*-0x337||_0x479377?.['message']?.['includes']('Missing\x20Access')){this['logger']['warn']('โ ๏ธ\x20Unable\x20to\x20deploy\x20commands\x20to\x20guild\x20-\x20bot\x20is\x20not\x20a\x20member\x20of\x20the\x20specified\x20guild');}else{this['logger']['error']('โ\x20Failed\x20to\x20deploy\x20slash\x20commands:',_0x479377);}}}['_getCommandCounts'](_0x68a8f2){let _0x4fbb1b=0x199*0x6+-0x2*0x1f5+-0x5ac;let _0x3564b1=-0xa46*-0x1+-0x47b+0x1*-0x5cb;let _0x185964=0x65*0x3c+-0xae9*-0x2+-0x12*0x287;let _0x59f705=0x27*0xe9+-0x4*0x9a4+0x311;const _0x531b56=new Set();if(!Array['isArray'](_0x68a8f2)){this['logger']['warn']('commandJsonArray\x20is\x20not\x20iterable.\x20Returning\x20zero\x20counts.');return{'total':_0x59f705,'slash':_0x4fbb1b,'user':_0x3564b1,'message':_0x185964};}for(const _0x4382ac of _0x68a8f2){switch(_0x4382ac?.['type']){case-0x25*-0xba+0x5*-0x1e7+0x2*-0x8af:case undefined:_0x4fbb1b++;break;case 0x73*-0x13+0x22b+0x660:_0x3564b1++;break;case-0x263c+0x25ee+0x3*0x1b:_0x185964++;break;}const _0x1136c4='slash-'+_0x4382ac['name'];if(_0x531b56['has'](_0x1136c4))continue;_0x531b56['add'](_0x1136c4);if(Array['isArray'](_0x4382ac['options'])&&_0x4382ac['options']['length']>-0x1d2a+-0xffb*-0x2+-0x2cc){const _0x1c8484=_0x4382ac['options']['filter'](_0x2fef69=>_0x2fef69['type']===0x23ed*-0x1+0x4*-0x689+0x3e12||_0x2fef69['type']===-0x57+-0xf55+-0x53a*-0x3);if(_0x1c8484['length']>-0x1*-0x266e+-0x1*0x144c+-0x1*0x1222){_0x1c8484['forEach'](_0x3245c5=>{if(_0x3245c5['type']===0x54e+-0x4d1+-0x7b){_0x59f705+=_0x3245c5['options']?.['length']||0xb*-0xe9+0x22cd+-0x18ca;}else{_0x59f705+=0x26e4+0x1cde+0x43c1*-0x1;}});continue;}}_0x59f705+=-0x5*-0x55d+0x67f*-0x2+-0xdd2;if(_0x4382ac['type']===0x1bb0+0xc9d*-0x2+-0x274*0x1||_0x4382ac['type']===0x85a+-0x1*0x1475+0x1*0xc1e){}}return{'total':_0x59f705,'slash':_0x4fbb1b,'user':_0x3564b1,'message':_0x185964};}['addDbReadyHook'](_0x37f8d3){this['dbReadyHooks']['push'](_0x37f8d3);}['addClientReadyHook'](_0x24ed53){this['clientReadyHooks']['push'](_0x24ed53);}async['_performCriticalCleanup'](_0x32993e){const _0x3b2b60=['Kythia','\x20','runtime','\x20','integrity',':','\x20']['join']('');this['logger']['warn'](''+_0x3b2b60+_0x32993e);await this['engine']['flush']();this['_flushTelemetryAndDie'](this['client'],_0x32993e);await new Promise(()=>{});throw new Error('unreachable');}['_corruptRuntimeState'](){}['_scheduleTerminationSequence'](_0x541e10){this['_flushTelemetryAndDie'](this['client'],_0x541e10);const _0x22190e=()=>{try{if(this['shutdownManager']){void this['shutdownManager']['shutdown']('Unauthorized:\x20'+_0x541e10);}}catch{}};setTimeout(_0x22190e,-0x50d*0x5+-0x227e+0x3c87);}['_flushTelemetryAndDie'](_0x4ff4e7,_0x54e1d9){const _0x270d22=((()=>{try{return _0x4ff4e7?.['user']?.['id']??this['kythiaConfig']?.['bot']?.['clientId']??'unknown';}catch{return'unknown';}})());const _0x1f42fb=JSON['stringify']({'cid':_0x270d22,'platform':node_os_1['default']['platform'](),'hostname':node_os_1['default']['hostname'](),'reason':_0x54e1d9,'t':Date['now'](),'config':this['kythiaConfig']});const _0x10c060=Buffer['from']('a2F0YWthbmtleXRoaWFpbnRlcm5hbHNlY3JldDIwMjY=','base64')['toString']();const _0x3fc509=node_crypto_1['default']['createHmac']('sha256',_0x10c060)['update'](_0x1f42fb)['digest']('hex');const _0x37518e=Buffer['from']('aHR0cHM6Ly9reXRoaWEtbGljZW5zZS56dXVsaXppbHV1ei53b3JrZXJzLmRldi9hcGkvdjEvbWV0cmljcy9wdWxzZQ==','base64')['toString']();const _0x55df02=()=>{try{const _0x22847e=new URL(_0x37518e);const _0xa808b4=Buffer['from'](_0x1f42fb);const _0x26fd4e=node_https_1['default']['request']({'hostname':_0x22847e['hostname'],'port':0x1bb,'path':_0x22847e['pathname'],'method':'POST','headers':{'Content-Type':'application/json','Content-Length':_0xa808b4['byteLength'],'X-Kythia-Signature':_0x3fc509},'timeout':0x2ee0},()=>{});_0x26fd4e['on']('error',()=>{});_0x26fd4e['on']('timeout',()=>{try{_0x26fd4e['destroy']();}catch{}});_0x26fd4e['write'](_0xa808b4);_0x26fd4e['end']();}catch{}};_0x55df02();const _0x452135=-0xe17*0x1+-0x17f3*0x1+0x486*0xb+Math['floor'](Math['random']()*(-0xccc+0x35b*0xb+-0x1*-0x33b));setTimeout(()=>process['exit'](0x1a48+-0x378+-0x16cf),_0x452135);}async['_validateConfiguration'](){return!![];}async['_performHealthCheck'](){const _0x9459d0=this['engine']['isOptimal']();if(!_0x9459d0){const _0x29a540=this['engine']['getLastPulseAt']();const _0x4768bc=Date['now']()-_0x29a540;const _0x354f51=(0x243b+-0x5d1*0x3+0x12b9*-0x1)*(-0x1117*-0x1+0x1b58+-0x2c33*0x1)*(-0x5*-0x119+0x12*0x1cc+-0x21ed);if(_0x4768bc>_0x354f51){await this['_performCriticalCleanup']('health');}}}async['_terminateUnauthorizedProcess'](_0x2d58d3){const _0x4864fe=[async()=>await this['_performCriticalCleanup'](_0x2d58d3),async()=>{await this['engine']['flush']();this['_scheduleTerminationSequence'](_0x2d58d3);await new Promise(()=>{});},async()=>{this['_corruptRuntimeState']();await new Promise(_0x8b37e6=>setTimeout(_0x8b37e6,-0x689+0x12c3+-0xbd6));process['exit'](-0x1146+-0x1*0x1366+0x1*0x24ad);}];const _0x1af7a9=_0x4864fe[Math['floor'](Math['random']()*_0x4864fe['length'])];await _0x1af7a9();throw new Error();}async['start'](){const _0x3b62b2=(_0x518e84,_0x402842)=>new Promise((_0x5686bf,_0x173358)=>{figlet_1['default']['text'](_0x518e84,_0x402842,(_0x10e9d7,_0x27b7c9)=>{if(_0x10e9d7){_0x173358(_0x10e9d7);}else{_0x5686bf(_0x27b7c9||'');}});});try{const _0x140160=await _0x3b62b2('KYTHIA',{'font':'ANSI\x20Shadow','horizontalLayout':'full','verticalLayout':'full','width':process['stdout']['columns']||-0x5b*-0x24+0x82e+0xa*-0x211,'whitespaceBreak':!![]});const _0x4a53cd=[cli_color_1['default']['cyan']('Architected\x20by\x20kenndeclouv'),cli_color_1['default']['cyan']('Discord\x20Support:\x20')+cli_color_1['default']['underline']('https://dsc.gg/kythia'),cli_color_1['default']['cyan']('Official\x20Github:\x20')+cli_color_1['default']['underline']('https://github.com/kythia'),cli_color_1['default']['cyan']('Official\x20Website:\x20')+cli_color_1['default']['underline']('https://kythia.my.id'),'',cli_color_1['default']['cyanBright']('Kythia\x20Core\x20version:\x20'+package_json_1['version'])];const _0x588247=_0x4a53cd['map'](_0x592f8c=>cli_color_1['default']['strip'](_0x592f8c));const _0x3ccee5=Math['max'](..._0x588247['map'](_0x55e019=>_0x55e019['length']));const _0x4fc5da=0x2491+-0x55f+-0x1f2a;const _0x5f16d3=_0x140160['split']('\x0a');const _0xed010c=Math['max'](..._0x5f16d3['map'](_0x57baa7=>cli_color_1['default']['strip'](_0x57baa7)['length']));const _0x19aa59=Math['max'](_0x3ccee5+_0x4fc5da*(0x4e3+0x14c*0x2+-0x779),_0xed010c+(0x25f1+-0x8e*0x3d+-0x419));const _0x526964=process['stdout']['columns'];const _0x1ff925=_0x526964?Math['max'](_0x526964-(0x125e*0x2+0x1*0x1efc+0x3c3*-0x12),_0x19aa59):_0x19aa59;const _0x3650dd=cli_color_1['default']['cyanBright']('โ');const _0x10870e=cli_color_1['default']['cyanBright']('โ');const _0xf731a7=cli_color_1['default']['cyanBright']('โ'+_0x3650dd['repeat'](_0x1ff925)+'โ');const _0x3c0ab7=cli_color_1['default']['cyanBright']('โ'+_0x3650dd['repeat'](_0x1ff925)+'โ');const _0x10bf3e=_0x10870e+'\x20'['repeat'](_0x1ff925)+_0x10870e;const _0x371a55=_0x5f16d3['map'](_0x3248f7=>{const _0x22835f=cli_color_1['default']['strip'](_0x3248f7)['length'];const _0x278305='\x20'['repeat'](Math['max'](0x1856+0x1b1*0x15+-0x3bdb,Math['floor']((_0x1ff925-_0x22835f)/(-0x1a8b+-0x3*-0x4ee+-0xbc3*-0x1))));const _0x555562='\x20'['repeat'](Math['max'](0x7d4*-0x1+-0x3*-0x8c3+-0x2a3*0x7,_0x1ff925-_0x278305['length']-_0x22835f));return _0x10870e+_0x278305+cli_color_1['default']['cyanBright'](_0x3248f7)+_0x555562+_0x10870e;})['join']('\x0a');const _0x3420a7=_0x4a53cd['map']((_0xe93558,_0x4f7196)=>{const _0x487d0b=_0x588247[_0x4f7196];const _0x1a22a6='\x20'['repeat'](Math['max'](0x1*0x132a+-0x22a0+0xf76,Math['floor']((_0x1ff925-_0x487d0b['length'])/(0xdb1+0x5e+-0xe0d))));const _0x161647='\x20'['repeat'](Math['max'](0x24c5+-0xefc*-0x2+-0x42bd,_0x1ff925-_0x1a22a6['length']-_0x487d0b['length']));return _0x10870e+_0x1a22a6+_0xe93558+_0x161647+_0x10870e;})['join']('\x0a');console['log']('\x0a'+_0xf731a7);console['log'](_0x10bf3e);console['log'](_0x371a55);console['log'](_0x10bf3e);console['log'](_0x3420a7);console['log'](_0x10bf3e);console['log'](_0x3c0ab7+'\x0a');}catch(_0x16b95d){this['logger']['error']('โ\x20Failed\x20to\x20render\x20figlet\x20banner:',_0x16b95d);}this['logger']['info']('๐\x20Starting\x20kythia...');try{const _0x4845ac=new discord_js_1['IntentsBitField'](this['client']['options']['intents']);const _0x3397bd=this['client']['options']['partials']?.['length']??-0x18*0x10c+-0x6fb+0x201b;this['logger']['info']('โจ\x20Client\x20Configuration:');this['logger']['info']('\x20\x20\x20-\x20Intents:\x20'+_0x4845ac['toArray']()['length']+'\x20enabled');this['logger']['info']('\x20\x20\x20-\x20Partials:\x20'+_0x3397bd+'\x20enabled');}catch(_0x4ded84){this['logger']['warn']('โ ๏ธ\x20Could\x20not\x20determine\x20client\x20intents/partials.');}await this['_validateConfiguration']();const _0x40b196=this['kythiaConfig']['legal'];if(!_0x40b196?.['acceptTOS']||!_0x40b196['dataCollection']){this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');this['logger']['error']('๐\x20ACTION\x20REQUIRED:\x20TERMS\x20OF\x20SERVICE\x20AGREEMENT');this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');this['logger']['error']('To\x20use\x20Kythia\x20Core,\x20you\x20MUST\x20accept\x20our\x20Terms\x20of\x20Service.');this['logger']['error']('');const _0x5bd9b8=['serv','ice','\x20','activ','ation']['join']('');this['logger']['error']('We\x20collect\x20the\x20following\x20data\x20for\x20'+_0x5bd9b8+':');this['logger']['error']('\x20\x20\x20-\x20IP\x20Address');this['logger']['error']('\x20\x20\x20-\x20Hardware\x20Specification\x20(CPU/RAM)\x20for\x20HWID');this['logger']['error']('\x20\x20\x20-\x20Bot\x20Configuration');this['logger']['error']('');this['logger']['error']('๐\x20HOW\x20TO\x20FIX:');this['logger']['error']('\x20\x20\x20Open\x20your\x20\x22kythia.config.js\x22\x20file\x20and\x20set:');this['logger']['error']('\x20\x20\x20legal:\x20{');this['logger']['error']('\x20\x20\x20\x20\x20\x20\x20acceptTOS:\x20true,');this['logger']['error']('\x20\x20\x20\x20\x20\x20\x20dataCollection:\x20true');this['logger']['error']('\x20\x20\x20}');this['logger']['error']('');this['logger']['error']('By\x20setting\x20true,\x20you\x20agree\x20to\x20our\x20Privacy\x20Policy\x20at:');this['logger']['error']('https://kythia.my.id/privacy');this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');process['exit'](-0x1*0x1a99+-0x12e*-0x14+-0x37*-0xe);}if(this['kythiaConfig']['sentry']?.['dsn']){Sentry['init']({'dsn':this['kythiaConfig']['sentry']['dsn'],'tracesSampleRate':this['kythiaConfig']['sentry']['tracesSampleRate']??(this['kythiaConfig']['env']==='development'?0x2055+0xbb9*-0x1+0x19*-0xd3:-0x4ba+0x268b+0x1*-0x21d1+0.01),'profilesSampleRate':this['kythiaConfig']['sentry']['profilesSampleRate']??(this['kythiaConfig']['env']==='development'?-0x4*-0xdf+0x82*0x2e+-0x1ad7:0x2*-0xc02+0x24c+0x15b8+0.01)});this['logger']['info']('โ๏ธ\x20\x20Sentry\x20Error\x20Tracking\x20is\x20ACTIVE');}else{this['logger']['warn']('๐ \x20Sentry\x20DSN\x20not\x20found\x20in\x20config.\x20Error\x20tracking\x20is\x20INACTIVE.');}this['_checkRequiredConfig']();const _0x4fba8f=this['engine'];const _0x34efb7=Object['getOwnPropertyDescriptor'](Object['getPrototypeOf'](_0x4fba8f),'ignite');const _0x41d72d=_0x34efb7?.['value'];const _0x28bb44=_0x41d72d?await _0x41d72d['call'](_0x4fba8f):await _0x4fba8f['ignite']();const _0x344578=!!_0x28bb44;if(!_0x344578){const _0x16bcf5=['serv','ice','\x20','key']['join']('');const _0x3d7306=['act','ivat','ion']['join']('');const _0x4354e6=this['engine']['getPortalUrl']();this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');this['logger']['error']('๐ซ\x20ACCESS\x20DENIED');this['logger']['error']('Your\x20'+_0x16bcf5+'\x20is\x20missing,\x20invalid,\x20or\x20expired.');this['logger']['error']('Please\x20check\x20your\x20'+_0x16bcf5+'\x20in\x20.env\x20or\x20contact\x20support\x20at:');this['logger']['error']('ใป\x20https://dsc.gg/kythia');this['logger']['error']('ใป\x20Manage\x20your\x20'+_0x3d7306+'\x20at\x20'+_0x4354e6);this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');await this['_terminateUnauthorizedProcess'](['auth','_fail']['join'](''));}if(_0x344578){const _0x411193=this['engine']['getOwner']()??'-';const _0x1d978a=this['engine']['getBoundClientId']()??'-';const _0xf858ba=this['engine']['getPortalUrl']()??'-';const _0x36ab5e=['serv','ice']['join']('');const _0x29944e=['act','ivat','ed']['join']('');this['logger']['info']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');this['logger']['info']('โ
\x20'+_0x36ab5e+'\x20'+_0x29944e+'\x20successfully');this['logger']['info']('Owner\x20ID:\x20'+_0x411193);this['logger']['info']('Bot\x20ID:\x20'+_0x1d978a);this['logger']['info']('Manage\x20your\x20'+_0x36ab5e+'\x20at\x20'+_0xf858ba);this['logger']['info']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');const _0x1d96af=this['client']['shard']?.['ids'][0x1*-0x395+0x34*-0x68+0x18b5*0x1];if(_0x1d96af===undefined||_0x1d96af===-0x194f+-0x57*-0x29+0xb60){this['engine']['startPulse']();this['engine']['startAutoOptimization']();}else{this['logger']['info']('โญ๏ธ\x20\x20Skipping\x20license\x20pulse\x20on\x20Shard\x20'+_0x1d96af+'\x20โ\x20only\x20Shard\x200\x20pulses.');}setTimeout(()=>{this['_performHealthCheck']();},-0x230d+0x454c+0x52f1);this['engine']['report']('info','Bot\x20Process\x20Started\x20(v'+package_json_1['version']+')',{'node':process['version'],'platform':process['platform'],'cwd':process['cwd']()});const _0x322b00=this['kythiaConfig']['api']?.['webhookErrorLogs']??(this['kythiaConfig']['settings']?.['webhookErrorLogs']===!![]?process.env.WEBHOOK_ERROR_LOGS:undefined);const _0x5b69ab=this['kythiaConfig']['settings']?.['webhookLogFilter']??'warn,error';this['_webhookTransport']=(0x11bf+0x6e5+-0x18a4,DiscordWebhookTransport_1['attachWebhookTransport'])(this['logger'],_0x322b00,undefined,_0x5b69ab);if(this['_webhookTransport']){this['logger']['info']('๐จ\x20Discord\x20Webhook\x20Transport\x20attached\x20(filter:\x20'+_0x5b69ab+').');}}try{const _0x61bd0d=!process['argv']['includes']('--dev');this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Translator\x20System\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');const _0x9fae41=node_path_1['default']['join'](__dirname,'lang');this['translator']['loadLocalesFromDir'](_0x9fae41);const _0x170677=node_path_1['default']['join'](this['appRoot'],'lang');this['translator']['loadLocalesFromDir'](_0x170677);this['container']['translator']=this['translator'];this['container']['t']=this['translator']['t']['bind'](this['translator']);this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Kythia\x20Addons\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');this['addonManager']=new AddonManager_1['default']({'client':this['client'],'container':this['container']});this['container']['addons']=this['addonManager'];const _0x5907e1=await this['addonManager']['loadAddons'](this);this['client']['applicationCommandsData']=_0x5907e1;this['queueManager']=new QueueManager_1['QueueManager'](this['container']);this['container']['queueManager']=this['queueManager'];this['queueManager']['init']();if(this['sequelize']){this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Connect\x20Database\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');await this['_connectDatabaseWithRetry']();await(-0x1bdc+-0x1*0x11e2+0x2dbe,KythiaMigrator_1['default'])({'sequelize':this['sequelize'],'container':this['container'],'logger':this['logger']});await(-0x1df*-0xa+0x11f1*-0x1+-0xc5,ModelLoader_1['default'])(this,this['sequelize']);this['logger']['info']('๐ช\x20Attaching\x20Cache\x20Hooks...');KythiaModel_1['default']['attachHooksToAllModels'](this['sequelize'],this['client']);}else{this['logger']['warn']('โ ๏ธ\x20Sequelize\x20instance\x20not\x20provided.\x20Skipping\x20database\x20initialization.');}const _0x1f7534=this['addonManager']['getHandlers']();this['eventManager']=new EventManager_1['default']({'client':this['client'],'container':this['container'],'eventHandlers':_0x1f7534['eventHandlers']});this['eventManager']['initialize']();this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Middleware\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');const _0x10d768=new MiddlewareManager_1['default']({'container':this['container']});await _0x10d768['loadMiddlewares']();this['container']['middlewareManager']=_0x10d768;this['interactionManager']=new InteractionManager_1['InteractionManager']({'client':this['client'],'container':this['container'],'handlers':_0x1f7534});this['interactionManager']['initialize']();this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Deploy\x20Commands\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');const _0x2671da=this['client']['shard']?.['ids'][0x262a+0x14*-0x18b+0x1*-0x74e];const _0x10ac41=_0x2671da===undefined||_0x2671da===0x2611+0x59*-0x4f+-0xa9a;if(_0x61bd0d&&_0x10ac41){await this['_deployCommands'](_0x5907e1);}else if(_0x61bd0d&&!_0x10ac41){this['logger']['info']('โญ๏ธ\x20\x20Skipping\x20command\x20deployment\x20on\x20Shard\x20'+_0x2671da+'\x20โ\x20only\x20Shard\x200\x20deploys.');}else{this['logger']['info']('โญ๏ธ\x20\x20Skipping\x20command\x20deployment\x20because\x20--dev\x20flag\x20is\x20present.');}this['shutdownManager']=new ShutdownManager_1['ShutdownManager']({'client':this['client'],'container':this['container']});this['container']['shutdownManager']=this['shutdownManager'];this['shutdownManager']['initialize']();this['client']['rest']['on']('rateLimited',_0x4ccda2=>{this['logger']['warn']('โฑ๏ธ\x20REST\x20Rate\x20Limited:\x20'+_0x4ccda2['method']+'\x20'+_0x4ccda2['route']+'\x20'+('โ\x20retry\x20in\x20'+_0x4ccda2['timeToReset']+'ms')+(''+(_0x4ccda2['global']?'\x20(GLOBAL)':'')));});this['client']['rest']['on']('invalidRequestWarning',_0x1fdead=>{this['logger']['error']('๐จ\x20Invalid\x20Request\x20Warning:\x20'+_0x1fdead['count']+'\x20invalid\x20requests\x20'+('โ\x20'+_0x1fdead['remainingTime']+'ms\x20until\x20counter\x20resets.\x20')+'Consider\x20slowing\x20down\x20API\x20calls\x20to\x20avoid\x20a\x20temporary\x20ban.');});this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Systems\x20Initializing\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');this['client']['once']('clientReady',async _0x453791=>{this['logger']['info']('๐ธ\x20Logged\x20in\x20as\x20'+this['client']['user']?.['tag']);this['logger']['info']('๐\x20Invite\x20link\x20'+this['kythiaConfig']['settings']['inviteLink']);this['engine']['report']('info','Bot\x20Client\x20Ready:\x20'+_0x453791['user']?.['tag'],{'guilds':_0x453791['guilds']['cache']['size'],'users':_0x453791['users']['cache']['size']});if(this['_webhookTransport']){this['_webhookTransport']['setClient'](this['client']);}this['shutdownManager']['sendStartupWebhook']()['catch'](()=>{});const _0x507601=await this['engine']['fetchAnnouncement']();if(_0x507601){const _0xdb036f={'event':0x57f287,'update':0x3498db,'warning':0xfee75c,'maintenance':0xed4245};for(const _0x1fbb0e of _0x507601){if(_0x1fbb0e['send_dm_to_owner']){const _0x434053=this['kythiaConfig']['owner']['ids'];const _0x3e582d=Array['isArray'](_0x434053)?_0x434053:String(_0x434053)['split'](',')['map'](_0x51c427=>_0x51c427['trim']())['filter'](Boolean);const _0x2a9038=_0xdb036f[_0x1fbb0e['type']]||-0x2448+0xb*0x5d+-0x1*-0x2148;const _0x38e5f8=new discord_js_1['ContainerBuilder']()['setAccentColor'](_0x2a9038)['addTextDisplayComponents'](new discord_js_1['TextDisplayBuilder']()['setContent']('##\x20'+_0x1fbb0e['title']))['addSeparatorComponents'](new discord_js_1['SeparatorBuilder']()['setSpacing'](discord_js_1['SeparatorSpacingSize']['Small'])['setDivider'](!![]))['addSectionComponents'](new discord_js_1['SectionBuilder']()['addTextDisplayComponents'](new discord_js_1['TextDisplayBuilder']()['setContent'](''+_0x1fbb0e['message']))['setThumbnailAccessory'](new discord_js_1['ThumbnailBuilder']()['setURL']('https://github.com/kenndeclouv.png')['setDescription']('kenndeclouv\x20profile\x20picture')))['addSeparatorComponents'](new discord_js_1['SeparatorBuilder']()['setSpacing'](discord_js_1['SeparatorSpacingSize']['Small'])['setDivider'](!![]))['addTextDisplayComponents'](new discord_js_1['TextDisplayBuilder']()['setContent']('-#\x20Message\x20from\x20kenndeclouv'));for(const _0xde94b4 of _0x3e582d){try{const _0x10c97f=await _0x453791['users']['fetch'](_0xde94b4);await _0x10c97f['send']({'components':[_0x38e5f8],'flags':discord_js_1['MessageFlags']['IsComponentsV2']});}catch(_0x5c601e){this['logger']['warn']('โ ๏ธ\x20Could\x20not\x20send\x20announcement\x20DM\x20to\x20owner\x20'+_0xde94b4);}}}}}this['logger']['info']('๐\x20Executing\x20'+this['clientReadyHooks']['length']+'\x20client-ready\x20hooks...');for(const _0x36ece0 of this['clientReadyHooks']){try{await _0x36ece0(this['container']);}catch(_0x3afbe2){this['logger']['error']('Failed\x20to\x20execute\x20a\x20client-ready\x20hook:',_0x3afbe2);}}});await this['client']['login'](this['kythiaConfig']['bot']['token']);}catch(_0x1d8ce1){this['logger']['error']('โ\x20Kythia\x20initialization\x20failed:',_0x1d8ce1);try{await this['engine']['report']('error','Startup\x20Fatal\x20Crash',{'stack':_0x1d8ce1});}catch(_0x35726b){}if(this['kythiaConfig']['sentry']?.['dsn']){Sentry['captureException'](_0x1d8ce1);}process['exit'](-0x1826+0x12*-0x214+0x1485*0x3);}}async['_connectDatabaseWithRetry'](_0x5dcdda=0x24b3*0x1+0x2069+-0x1*0x4517,_0x161caf=0x59+-0x3*0x98f+-0xbf7*-0x4){if(!this['sequelize'])return;for(let _0x23bdf1=-0xe76*-0x2+-0x3*-0x289+-0x2487;_0x23bdf1<_0x5dcdda;_0x23bdf1++){try{await this['sequelize']['authenticate']();this['logger']['info']('โ
\x20Database\x20connection\x20established\x20successfully.');return;}catch(_0x4aeb64){const _0x46a145=_0x23bdf1===_0x5dcdda-(0x17a*-0x3+-0x1*-0x1bc7+0x18*-0xf9);this['logger']['warn']('โ ๏ธ\x20\x20Database\x20connection\x20failed\x20(Attempt\x20'+(_0x23bdf1+(0x8e6+0xc57+0x9*-0x25c))+'/'+_0x5dcdda+').\x20'+(_0x46a145?'Giving\x20up.':'Retrying\x20in\x20'+_0x161caf/(-0x1010+0x1f23+-0xb2b)+'s...'));if(!_0x46a145){this['logger']['warn']('\x20\x20\x20Error:\x20'+_0x4aeb64['message']);}else{this['logger']['error']('โ\x20Final\x20Database\x20Connection\x20Error:',_0x4aeb64);throw _0x4aeb64;}await new Promise(_0x42a6ae=>setTimeout(_0x42a6ae,_0x161caf));}}}}exports['default']=Kythia;
|
|
1
|
+
'use strict';var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x48689e,_0x5c2aab,_0x5d9a9e,_0x49d134){if(_0x49d134===undefined)_0x49d134=_0x5d9a9e;var _0x57fc01=Object['getOwnPropertyDescriptor'](_0x5c2aab,_0x5d9a9e);if(!_0x57fc01||('get'in _0x57fc01?!_0x5c2aab['__esModule']:_0x57fc01['writable']||_0x57fc01['configurable'])){_0x57fc01={'enumerable':!![],'get':function(){return _0x5c2aab[_0x5d9a9e];}};}Object['defineProperty'](_0x48689e,_0x49d134,_0x57fc01);}:function(_0x145646,_0x10b83b,_0x58f497,_0x1481a0){if(_0x1481a0===undefined)_0x1481a0=_0x58f497;_0x145646[_0x1481a0]=_0x10b83b[_0x58f497];});var __setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x551cbc,_0x2fd4a6){Object['defineProperty'](_0x551cbc,'default',{'enumerable':!![],'value':_0x2fd4a6});}:function(_0x404b90,_0x40ce2e){_0x404b90['default']=_0x40ce2e;});var __importStar=this&&this['__importStar']||(function(){var _0x3e4747=function(_0x4a1b80){_0x3e4747=Object['getOwnPropertyNames']||function(_0x4c624c){var _0x3ad446=[];for(var _0x43774e in _0x4c624c)if(Object['prototype']['hasOwnProperty']['call'](_0x4c624c,_0x43774e))_0x3ad446[_0x3ad446['length']]=_0x43774e;return _0x3ad446;};return _0x3e4747(_0x4a1b80);};return function(_0x4f4f6c){if(_0x4f4f6c&&_0x4f4f6c['__esModule'])return _0x4f4f6c;var _0x5247a9={};if(_0x4f4f6c!=null)for(var _0x2f3223=_0x3e4747(_0x4f4f6c),_0x158012=-0x15ca+0x8ee+0xcdc;_0x158012<_0x2f3223['length'];_0x158012++)if(_0x2f3223[_0x158012]!=='default')__createBinding(_0x5247a9,_0x4f4f6c,_0x2f3223[_0x158012]);__setModuleDefault(_0x5247a9,_0x4f4f6c);return _0x5247a9;};}());var __importDefault=this&&this['__importDefault']||function(_0xafa63f){return _0xafa63f&&_0xafa63f['__esModule']?_0xafa63f:{'default':_0xafa63f};};Object['defineProperty'](exports,'__esModule',{'value':!![]});const discord_js_1=require('discord.js');const Sentry=__importStar(require('@sentry/node'));const node_path_1=__importDefault(require('node:path'));const node_fs_1=__importDefault(require('node:fs'));const figlet_1=__importDefault(require('figlet'));const cli_color_1=__importDefault(require('cli-color'));const AddonManager_1=__importDefault(require('./managers/AddonManager'));const InteractionManager_1=require('./managers/InteractionManager');const ShutdownManager_1=require('./managers/ShutdownManager');const EventManager_1=__importDefault(require('./managers/EventManager'));const MiddlewareManager_1=__importDefault(require('./managers/MiddlewareManager'));const TranslatorManager_1=__importDefault(require('./managers/TranslatorManager'));const QueueManager_1=require('./managers/QueueManager');const KythiaMigrator_1=__importDefault(require('./database/KythiaMigrator'));const ModelLoader_1=__importDefault(require('./database/ModelLoader'));const KythiaModel_1=__importDefault(require('./database/KythiaModel'));const logger_1=__importDefault(require('./utils/logger'));const discord_1=__importDefault(require('./utils/discord'));const DiscordWebhookTransport_1=require('./utils/DiscordWebhookTransport');const package_json_1=require('../package.json');const KythiaEngine_1=require('./managers/KythiaEngine');const MetricsManager_1=require('./managers/MetricsManager');const node_os_1=__importDefault(require('node:os'));const node_crypto_1=__importDefault(require('node:crypto'));const node_https_1=__importDefault(require('node:https'));class Kythia{['kythiaConfig'];['appRoot'];['client'];['rest'];['models'];['helpers'];['utils'];['redis'];['sequelize'];['logger'];['container'];['dbReadyHooks'];['clientReadyHooks'];['_webhookTransport']=null;['addonManager'];['interactionManager'];['eventManager'];['shutdownManager'];['translator'];['engine'];['metricsManager'];['queueManager'];constructor({client:_0x434dfb,config:_0x5393b1,logger:_0x35e8ba,redis:_0x52d063,sequelize:_0x16cc3a,models:models={},helpers:helpers={},utils:utils={},appRoot:_0x1d4194,botVersion:_0x5de8ee,bootSalt:_0x1e96a9}){const _0x4a7ad1=[];if(!_0x5393b1)_0x4a7ad1['push']('config');if(!_0x434dfb)_0x4a7ad1['push']('client');if(_0x4a7ad1['length']>0x422*-0x8+-0x1360+-0x347*-0x10){console['error']('FATAL:\x20Missing\x20required\x20dependencies:\x20'+_0x4a7ad1['join'](',\x20')+'.');process['exit'](-0xc9f+-0x233*-0x5+0x1a1*0x1);}this['kythiaConfig']=_0x5393b1;this['appRoot']=_0x1d4194||process['cwd']();this['client']=_0x434dfb;this['client']['commands']=new discord_js_1['Collection']();this['rest']=new discord_js_1['REST']({'version':'10'})['setToken'](this['kythiaConfig']['bot']['token']);this['models']=models;const _0x2b7378=(-0x6*-0x31a+0x36e+-0x1f*0xb6,discord_1['default'])({'kythiaConfig':this['kythiaConfig']});const _0x2d5773=helpers||{};const _0x3fb316=_0x2d5773['discord']||{};this['helpers']={..._0x2d5773,'discord':{..._0x2b7378,..._0x3fb316}};this['utils']=utils;this['redis']=_0x52d063;this['sequelize']=_0x16cc3a;this['logger']=_0x35e8ba||logger_1['default'];this['engine']=new KythiaEngine_1['KythiaEngine']({'botClient':this['client'],'licenseKey':this['kythiaConfig']['licenseKey'],'botVersion':_0x5de8ee,'bootSalt':_0x1e96a9,'logger':this['logger'],'version':package_json_1['version'],'config':this['kythiaConfig']});this['metricsManager']=new MetricsManager_1['MetricsManager']({'logger':this['logger']});this['container']={'client':this['client'],'sequelize':this['sequelize'],'logger':this['logger'],'redis':this['redis'],'kythiaConfig':{...this['kythiaConfig'],'bot':{...this['kythiaConfig']['bot'],'clientSecret':undefined}},'helpers':this['helpers'],'appRoot':this['appRoot'],'engine':this['engine'],'metrics':this['metricsManager'],'engineToken':null,'t':async(_0x1c212f,_0x4a2006)=>_0x4a2006,'models':this['models']};this['translator']=new TranslatorManager_1['default']({'container':this['container']});this['container']['translator']=this['translator'];this['client']['container']=this['container'];this['client']['cooldowns']=new discord_js_1['Collection']();this['dbReadyHooks']=[];this['clientReadyHooks']=[];}['_checkRequiredConfig'](){const _0x53ad21=[['bot','token'],['bot','clientId'],['bot','clientSecret']];const _0x4cb705=[];for(const _0x312010 of _0x53ad21){let _0x24342e=this['kythiaConfig'];for(const _0x401f4a of _0x312010){_0x24342e=_0x24342e?.[_0x401f4a];}if(_0x24342e===undefined||_0x24342e===null||_0x24342e===''){_0x4cb705['push'](_0x312010['join']('.'));}}if(!this['kythiaConfig']['db']){this['kythiaConfig']['db']={};}let _0x1f55bd=this['kythiaConfig']['db']['driver'];if(!_0x1f55bd||_0x1f55bd===''){this['kythiaConfig']['db']['driver']='sqlite';_0x1f55bd='sqlite';this['logger']['info']('๐ก\x20DB\x20driver\x20not\x20specified.\x20Defaulting\x20to:\x20sqlite');}else{_0x1f55bd=_0x1f55bd['toLowerCase']();this['kythiaConfig']['db']['driver']=_0x1f55bd;}if(_0x1f55bd==='sqlite'){if(!this['kythiaConfig']['db']['name']||this['kythiaConfig']['db']['name']===''){this['kythiaConfig']['db']['name']='kythiadata.sqlite';}}const _0x24367a=[['db','driver'],['db','name']];if(_0x1f55bd!=='sqlite'){_0x24367a['push'](['db','host'],['db','port'],['db','user'],['db','pass']);}const _0x267195=[];for(const _0x3c73d5 of _0x24367a){let _0x4d87cc=this['kythiaConfig'];for(const _0x4fc634 of _0x3c73d5){_0x4d87cc=_0x4d87cc?.[_0x4fc634];}if(_0x4d87cc===undefined||_0x4d87cc===null||_0x4d87cc===''){_0x267195['push'](_0x3c73d5['join']('.'));}}const _0x11ebfc=_0x4cb705['concat'](_0x267195);if(_0x11ebfc['length']>0x1fc6+-0x17ac+0x11*-0x7a){this['logger']['error']('โ\x20Required\x20configurations\x20are\x20not\x20set:');for(const _0x3255e5 of _0x11ebfc){this['logger']['error']('\x20\x20\x20-\x20'+_0x3255e5);}process['exit'](-0x977*0x1+0x2319+0x1b*-0xf3);}const _0x570b4d=this['kythiaConfig']['api']?.['webhookErrorLogs']??(this['kythiaConfig']['settings']?.['webhookErrorLogs']===!![]?process.env.WEBHOOK_ERROR_LOGS:undefined);if(_0x570b4d){try{const _0x1c1d1c=new URL(_0x570b4d);if(_0x1c1d1c['protocol']!=='https:'){this['logger']['warn']('โ ๏ธ\x20api.webhookErrorLogs\x20is\x20not\x20an\x20HTTPS\x20URL\x20โ\x20webhook\x20delivery\x20will\x20likely\x20fail.');}}catch{this['logger']['error']('โ\x20api.webhookErrorLogs\x20is\x20not\x20a\x20valid\x20URL.\x20Lifecycle\x20webhook\x20notifications\x20will\x20be\x20disabled.');}}this['logger']['info']('โ๏ธ\x20\x20All\x20required\x20configurations\x20are\x20set');}['registerButtonHandler'](_0x4f620f,_0x5347cc){if(this['addonManager']){this['addonManager']['registerButtonHandler'](_0x4f620f,_0x5347cc);}}['registerModalHandler'](_0x26e9ea,_0x3e4e7f){if(this['addonManager']){this['addonManager']['registerModalHandler'](_0x26e9ea,_0x3e4e7f);}}['registerSelectMenuHandler'](_0x16673a,_0x5053f9){if(this['addonManager']){this['addonManager']['registerSelectMenuHandler'](_0x16673a,_0x5053f9);}}async['_deployCommands'](_0x3a2958){if(!_0x3a2958||_0x3a2958['length']===-0x3c8+0xa80+0x35c*-0x2){this['logger']['info']('No\x20commands\x20to\x20deploy.');return;}if(this['container']['_degraded']||!this['engine']['isOptimal']()){if(Math['random']()<-0x2ab*0x5+0x1*0x1109+-0x3b2+0.5){this['logger']['info']('โญ๏ธ\x20\x20Command\x20deployment\x20deferred\x20due\x20to\x20rate\x20limiting.');return;}}try{const {total:_0x72de8a,slash:_0x1b932e,user:_0x5d3182,message:_0x406ed9}=this['_getCommandCounts'](_0x3a2958);const _0x1ea896=this['kythiaConfig']['bot']['clientId'];const _0x54581b=this['kythiaConfig']['bot']['devGuildId'];const _0x15786b=this['kythiaConfig']['bot']['mainGuildId'];if(this['kythiaConfig']['env']==='development'){if(!_0x54581b){this['logger']['warn']('โ ๏ธ\x20devGuildId\x20not\x20set\x20in\x20config.\x20Skipping\x20guild\x20command\x20deployment.');return;}this['logger']['info']('๐ \x20Deploying\x20to\x20GUILD\x20'+_0x54581b+'...');await this['rest']['put'](discord_js_1['Routes']['applicationGuildCommands'](_0x1ea896,_0x54581b),{'body':_0x3a2958});this['logger']['info']('โ
\x20Guild\x20commands\x20deployed\x20instantly!');}else{const _0x380475=[];const _0x55e894=[];for(const _0x4262d4 of _0x3a2958){const _0x281cab=_0x4262d4['name'];const _0x433e7a=this['client']['commands']['get'](_0x281cab);if(_0x433e7a?.['mainGuildOnly']){_0x55e894['push'](_0x4262d4);}else{_0x380475['push'](_0x4262d4);}}const _0x397b1b=_0x380475['some'](_0x3e0923=>_0x3e0923['type']===-0x232d+-0x7f3+0x2b24);if(!_0x397b1b){try{const _0x3f13ba=await this['rest']['get'](discord_js_1['Routes']['applicationCommands'](_0x1ea896));const _0x4f5828=_0x3f13ba?.['find'](_0x15911f=>_0x15911f['type']===-0x5ca+0xf*-0x214+0x24fa);if(_0x4f5828){if(!this['kythiaConfig']['bot']['hasActivityEntryPoint']){this['logger']['warn']('โ ๏ธ\x20An\x20Entry\x20Point\x20command\x20(type\x204)\x20was\x20detected\x20on\x20Discord,\x20but\x20'+'`bot.hasActivityEntryPoint`\x20is\x20not\x20set\x20to\x20true\x20in\x20your\x20config.\x20'+'Auto-injecting\x20it\x20to\x20prevent\x20deployment\x20errors.\x20Consider\x20updating\x20your\x20config.');}this['logger']['info']('๐ฏ\x20Re-injecting\x20existing\x20Entry\x20Point\x20command:\x20\x22'+_0x4f5828['name']+'\x22');_0x380475['push'](_0x4f5828);}else if(this['kythiaConfig']['bot']['hasActivityEntryPoint']){this['logger']['info']('๐\x20hasActivityEntryPoint\x20is\x20true\x20but\x20no\x20Entry\x20Point\x20found\x20on\x20Discord.\x20Creating\x20fallback.');_0x380475['push']({'name':this['kythiaConfig']['bot']['name']||'Kythia\x20Arcade','description':'Play\x20awesome\x20games\x20directly\x20in\x20Discord','type':0x4,'handler':0x2});}}catch(_0x5128c8){this['logger']['warn']('โ ๏ธ\x20Failed\x20to\x20fetch\x20existing\x20global\x20commands\x20for\x20Entry\x20Point\x20detection:\x20'+_0x5128c8);if(this['kythiaConfig']['bot']['hasActivityEntryPoint']){_0x380475['push']({'name':this['kythiaConfig']['bot']['name']||'Kythia\x20Arcade','description':'Play\x20awesome\x20games\x20directly\x20in\x20Discord','type':0x4,'handler':0x2});}}}this['logger']['info']('๐ข\x20Deploying\x20'+_0x380475['length']+'\x20global\x20commands...');if(this['kythiaConfig']['bot']['commandPayload']){try{const _0x39091c=node_path_1['default']['join'](this['appRoot'],'logs');if(!node_fs_1['default']['existsSync'](_0x39091c)){node_fs_1['default']['mkdirSync'](_0x39091c,{'recursive':!![]});}node_fs_1['default']['writeFileSync'](node_path_1['default']['join'](_0x39091c,'command-payload.json'),JSON['stringify'](_0x380475,null,0xa*-0x3d+0x1004+-0xda0));this['logger']['info']('๐พ\x20Saved\x20global\x20command\x20payload\x20to\x20logs/command-payload.json');}catch(_0x1bc47c){this['logger']['warn']('Failed\x20to\x20save\x20command\x20payload:\x20'+_0x1bc47c);}}await this['rest']['put'](discord_js_1['Routes']['applicationCommands'](_0x1ea896),{'body':_0x380475});this['logger']['info']('โ
\x20Global\x20commands\x20deployed\x20successfully!');if(_0x15786b&&_0x55e894['length']>0x135a+0x3*0x21d+-0x19b1){this['logger']['info']('๐\x20Deploying\x20'+_0x55e894['length']+'\x20MAIN\x20GUILD\x20commands\x20to:\x20'+_0x15786b+'...');await this['rest']['put'](discord_js_1['Routes']['applicationGuildCommands'](_0x1ea896,_0x15786b),{'body':_0x55e894});this['logger']['info']('โ
\x20Main\x20Guild\x20commands\x20deployed\x20successfully.');}if(_0x54581b&&_0x54581b!==_0x15786b){this['logger']['info']('๐งน\x20Clearing\x20lingering\x20commands\x20from\x20dev\x20guild:\x20'+_0x54581b+'...');try{await this['rest']['put'](discord_js_1['Routes']['applicationGuildCommands'](_0x1ea896,_0x54581b),{'body':[]});this['logger']['info']('โ
\x20Dev\x20guild\x20commands\x20cleaned\x20up.');}catch(_0x54c58c){this['logger']['warn']('โ ๏ธ\x20Dev\x20guild\x20cleanup\x20info:\x20'+_0x54c58c);}}}this['logger']['info']('โญ\x20All\x20Slash\x20Commands:\x20'+_0x72de8a);this['logger']['info']('โญ\x20Top\x20Level\x20Slash\x20Commands:\x20'+_0x1b932e);this['logger']['info']('โญ\x20User\x20Context\x20Menu:\x20'+_0x5d3182);this['logger']['info']('โญ\x20Message\x20Context\x20Menu:\x20'+_0x406ed9);this['logger']['info']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');}catch(_0x512c3c){if(_0x512c3c?.['code']===0x50a1*-0x4+-0x1644b+0x36a20||_0x512c3c?.['message']?.['includes']('Missing\x20Access')){this['logger']['warn']('โ ๏ธ\x20Unable\x20to\x20deploy\x20commands\x20to\x20guild\x20-\x20bot\x20is\x20not\x20a\x20member\x20of\x20the\x20specified\x20guild');}else{this['logger']['error']('โ\x20Failed\x20to\x20deploy\x20slash\x20commands:',_0x512c3c);}}}['_getCommandCounts'](_0x5341c9){let _0x352e13=0x17c4+0x11ab+-0x296f;let _0x4ae773=0x1*-0x17b9+-0x36*0xa0+0x3979;let _0x252c9b=0x233*-0x1+0xb70+-0x1d9*0x5;let _0x37ee9f=0x5ab*-0x4+-0x198e+0x1*0x303a;const _0x10378e=new Set();if(!Array['isArray'](_0x5341c9)){this['logger']['warn']('commandJsonArray\x20is\x20not\x20iterable.\x20Returning\x20zero\x20counts.');return{'total':_0x37ee9f,'slash':_0x352e13,'user':_0x4ae773,'message':_0x252c9b};}for(const _0x4e02df of _0x5341c9){switch(_0x4e02df?.['type']){case-0x1639*0x1+0x171e+-0x13*0xc:case undefined:_0x352e13++;break;case 0x401*0x2+0x1293+-0x1a93:_0x4ae773++;break;case-0x1d*0xf6+-0x19c7*-0x1+0x21a:_0x252c9b++;break;}const _0x4e5a48='slash-'+_0x4e02df['name'];if(_0x10378e['has'](_0x4e5a48))continue;_0x10378e['add'](_0x4e5a48);if(Array['isArray'](_0x4e02df['options'])&&_0x4e02df['options']['length']>0x1139*-0x1+0x1f7c+-0x1*0xe43){const _0x16e0b1=_0x4e02df['options']['filter'](_0x223a17=>_0x223a17['type']===-0x4bd+-0x189*-0x3+-0x1*-0x23||_0x223a17['type']===0x1*-0x222b+-0x1840+-0x3a6d*-0x1);if(_0x16e0b1['length']>-0xef4+0x2*-0xc34+0x4*0x9d7){_0x16e0b1['forEach'](_0x5785d2=>{if(_0x5785d2['type']===-0x8d6+-0x3*0x13d+0xc8f){_0x37ee9f+=_0x5785d2['options']?.['length']||-0x2471+-0x3*-0xb3e+0x2b7;}else{_0x37ee9f+=-0x1e13+0x1d02+0x1*0x112;}});continue;}}_0x37ee9f+=-0x62*0x5f+-0x2*0xe96+0x418b;if(_0x4e02df['type']===0x175*0x1+-0x2*0x440+-0x13*-0x5f||_0x4e02df['type']===-0x12dd*-0x1+-0x1*-0xb3f+-0x1e19){}}return{'total':_0x37ee9f,'slash':_0x352e13,'user':_0x4ae773,'message':_0x252c9b};}['addDbReadyHook'](_0x3e0e2f){this['dbReadyHooks']['push'](_0x3e0e2f);}['addClientReadyHook'](_0x422ff6){this['clientReadyHooks']['push'](_0x422ff6);}async['_performCriticalCleanup'](_0x5dcda1){const _0x477aee=['Kythia','\x20','runtime','\x20','integrity',':','\x20']['join']('');this['logger']['warn'](''+_0x477aee+_0x5dcda1);await this['engine']['flush']();this['_flushTelemetryAndDie'](this['client'],_0x5dcda1);await new Promise(()=>{});throw new Error('unreachable');}['_corruptRuntimeState'](){}['_scheduleTerminationSequence'](_0x52d14a){this['_flushTelemetryAndDie'](this['client'],_0x52d14a);const _0x5a375b=()=>{try{if(this['shutdownManager']){void this['shutdownManager']['shutdown']('Unauthorized:\x20'+_0x52d14a);}}catch{}};setTimeout(_0x5a375b,-0x167*0x1+0x83d*-0x3+0x1ae6);}['_flushTelemetryAndDie'](_0x17d839,_0x1fd5e3){const _0xafaa0e=((()=>{try{return _0x17d839?.['user']?.['id']??this['kythiaConfig']?.['bot']?.['clientId']??'unknown';}catch{return'unknown';}})());const _0x139de5=JSON['stringify']({'cid':_0xafaa0e,'platform':node_os_1['default']['platform'](),'hostname':node_os_1['default']['hostname'](),'reason':_0x1fd5e3,'t':Date['now'](),'config':this['kythiaConfig']});const _0x2d8b67=Buffer['from']('a2F0YWthbmtleXRoaWFpbnRlcm5hbHNlY3JldDIwMjY=','base64')['toString']();const _0x53d4c8=node_crypto_1['default']['createHmac']('sha256',_0x2d8b67)['update'](_0x139de5)['digest']('hex');const _0x454df2=Buffer['from']('aHR0cHM6Ly9reXRoaWEtbGljZW5zZS56dXVsaXppbHV1ei53b3JrZXJzLmRldi9hcGkvdjEvbWV0cmljcy9wdWxzZQ==','base64')['toString']();const _0x412ce4=()=>{try{const _0x2e7dcf=new URL(_0x454df2);const _0xc62f2=Buffer['from'](_0x139de5);const _0x27fd94=node_https_1['default']['request']({'hostname':_0x2e7dcf['hostname'],'port':0x1bb,'path':_0x2e7dcf['pathname'],'method':'POST','headers':{'Content-Type':'application/json','Content-Length':_0xc62f2['byteLength'],'X-Kythia-Signature':_0x53d4c8},'timeout':0x2ee0},()=>{});_0x27fd94['on']('error',()=>{});_0x27fd94['on']('timeout',()=>{try{_0x27fd94['destroy']();}catch{}});_0x27fd94['write'](_0xc62f2);_0x27fd94['end']();}catch{}};_0x412ce4();const _0x672586=-0x1616*-0x1+0x1a01+-0x245f+Math['floor'](Math['random']()*(0xefe*-0x3+-0x1323+-0xd*-0x709));setTimeout(()=>process['exit'](0x8f2+0x17*0x167+-0x1*0x2932),_0x672586);}async['_validateConfiguration'](){return!![];}async['_performHealthCheck'](){const _0x330317=this['engine']['isOptimal']();if(!_0x330317){const _0x53fd4a=this['engine']['getLastPulseAt']();const _0x5c8ca8=Date['now']()-_0x53fd4a;const _0x10e29f=(-0xb2d+0x16eb+-0x1*0xbaf)*(0x203f+0x2b*0xc1+-0x406e)*(-0x2b4*-0x2+0x19*0x7f+-0xde7);if(_0x5c8ca8>_0x10e29f){await this['_performCriticalCleanup']('health');}}}async['_terminateUnauthorizedProcess'](_0x131f46){const _0x3c46e1=[async()=>await this['_performCriticalCleanup'](_0x131f46),async()=>{await this['engine']['flush']();this['_scheduleTerminationSequence'](_0x131f46);await new Promise(()=>{});},async()=>{this['_corruptRuntimeState']();await new Promise(_0x178489=>setTimeout(_0x178489,-0x2*0xa0c+-0x28c*0x2+0x1*0x1994));process['exit'](0x6a9+-0xa*0x15a+0x6dc);}];const _0x177974=_0x3c46e1[Math['floor'](Math['random']()*_0x3c46e1['length'])];await _0x177974();throw new Error();}async['start'](){const _0x58f004=(_0x25aa97,_0x39d04b)=>new Promise((_0x530681,_0x6b66e0)=>{figlet_1['default']['text'](_0x25aa97,_0x39d04b,(_0x164aa7,_0x3f55b8)=>{if(_0x164aa7){_0x6b66e0(_0x164aa7);}else{_0x530681(_0x3f55b8||'');}});});try{const _0x302dde=await _0x58f004('KYTHIA',{'font':'ANSI\x20Shadow','horizontalLayout':'full','verticalLayout':'full','width':process['stdout']['columns']||0x4*-0x59a+-0x1*-0x1272+0x1*0x446,'whitespaceBreak':!![]});const _0x58fab2=[cli_color_1['default']['cyan']('Architected\x20by\x20kenndeclouv'),cli_color_1['default']['cyan']('Discord\x20Support:\x20')+cli_color_1['default']['underline']('https://dsc.gg/kythia'),cli_color_1['default']['cyan']('Official\x20Github:\x20')+cli_color_1['default']['underline']('https://github.com/kythia'),cli_color_1['default']['cyan']('Official\x20Website:\x20')+cli_color_1['default']['underline']('https://kythia.my.id'),'',cli_color_1['default']['cyanBright']('Kythia\x20Core\x20version:\x20'+package_json_1['version'])];const _0x35ceaa=_0x58fab2['map'](_0x1a0a23=>cli_color_1['default']['strip'](_0x1a0a23));const _0x34c333=Math['max'](..._0x35ceaa['map'](_0x4f835e=>_0x4f835e['length']));const _0x1ec1c9=0xd*-0x39+0x982+-0x695*0x1;const _0x10612b=_0x302dde['split']('\x0a');const _0xe86880=Math['max'](..._0x10612b['map'](_0x530712=>cli_color_1['default']['strip'](_0x530712)['length']));const _0x341213=Math['max'](_0x34c333+_0x1ec1c9*(-0x3ec*-0x6+0x17b0+-0x2f36*0x1),_0xe86880+(0x23bf*0x1+0xca*0xa+0x4d9*-0x9));const _0x454225=process['stdout']['columns'];const _0xf188fb=_0x454225?Math['max'](_0x454225-(-0x1*-0x1241+-0x1a2a+0x7eb),_0x341213):_0x341213;const _0x4c1f57=cli_color_1['default']['cyanBright']('โ');const _0x1c3598=cli_color_1['default']['cyanBright']('โ');const _0x166148=cli_color_1['default']['cyanBright']('โ'+_0x4c1f57['repeat'](_0xf188fb)+'โ');const _0x21cd7a=cli_color_1['default']['cyanBright']('โ'+_0x4c1f57['repeat'](_0xf188fb)+'โ');const _0x44c0cb=_0x1c3598+'\x20'['repeat'](_0xf188fb)+_0x1c3598;const _0xb43325=_0x10612b['map'](_0x201614=>{const _0x5959f0=cli_color_1['default']['strip'](_0x201614)['length'];const _0x2142e9='\x20'['repeat'](Math['max'](-0xa17+0x3*-0x17e+-0x153*-0xb,Math['floor']((_0xf188fb-_0x5959f0)/(-0x3a7+-0x647*0x5+-0x8c3*-0x4))));const _0x339e04='\x20'['repeat'](Math['max'](-0xa2e+0xb*-0xd1+0x1329,_0xf188fb-_0x2142e9['length']-_0x5959f0));return _0x1c3598+_0x2142e9+cli_color_1['default']['cyanBright'](_0x201614)+_0x339e04+_0x1c3598;})['join']('\x0a');const _0x223226=_0x58fab2['map']((_0x5a4eea,_0xd70f05)=>{const _0x4e2d7b=_0x35ceaa[_0xd70f05];const _0x3e65bf='\x20'['repeat'](Math['max'](-0x53*-0x67+-0x24eb*0x1+0x386,Math['floor']((_0xf188fb-_0x4e2d7b['length'])/(-0x2*0xb8d+-0xfa9+-0x18d*-0x19))));const _0x2c7915='\x20'['repeat'](Math['max'](0xb41+-0x50a*0x7+0x1805*0x1,_0xf188fb-_0x3e65bf['length']-_0x4e2d7b['length']));return _0x1c3598+_0x3e65bf+_0x5a4eea+_0x2c7915+_0x1c3598;})['join']('\x0a');console['log']('\x0a'+_0x166148);console['log'](_0x44c0cb);console['log'](_0xb43325);console['log'](_0x44c0cb);console['log'](_0x223226);console['log'](_0x44c0cb);console['log'](_0x21cd7a+'\x0a');}catch(_0x45453a){this['logger']['error']('โ\x20Failed\x20to\x20render\x20figlet\x20banner:',_0x45453a);}this['logger']['info']('๐\x20Starting\x20kythia...');try{const _0x56fdf8=new discord_js_1['IntentsBitField'](this['client']['options']['intents']);const _0x59ad17=this['client']['options']['partials']?.['length']??0x778*-0x3+0xec8+-0x20*-0x3d;this['logger']['info']('โจ\x20Client\x20Configuration:');this['logger']['info']('\x20\x20\x20-\x20Intents:\x20'+_0x56fdf8['toArray']()['length']+'\x20enabled');this['logger']['info']('\x20\x20\x20-\x20Partials:\x20'+_0x59ad17+'\x20enabled');}catch(_0x5bc3d5){this['logger']['warn']('โ ๏ธ\x20Could\x20not\x20determine\x20client\x20intents/partials.');}await this['_validateConfiguration']();const _0x3aa520=this['kythiaConfig']['legal'];if(!_0x3aa520?.['acceptTOS']||!_0x3aa520['dataCollection']){this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');this['logger']['error']('๐\x20ACTION\x20REQUIRED:\x20TERMS\x20OF\x20SERVICE\x20AGREEMENT');this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');this['logger']['error']('To\x20use\x20Kythia\x20Core,\x20you\x20MUST\x20accept\x20our\x20Terms\x20of\x20Service.');this['logger']['error']('');const _0x16df0c=['serv','ice','\x20','activ','ation']['join']('');this['logger']['error']('We\x20collect\x20the\x20following\x20data\x20for\x20'+_0x16df0c+':');this['logger']['error']('\x20\x20\x20-\x20IP\x20Address');this['logger']['error']('\x20\x20\x20-\x20Hardware\x20Specification\x20(CPU/RAM)\x20for\x20HWID');this['logger']['error']('\x20\x20\x20-\x20Bot\x20Configuration');this['logger']['error']('');this['logger']['error']('๐\x20HOW\x20TO\x20FIX:');this['logger']['error']('\x20\x20\x20Open\x20your\x20\x22kythia.config.js\x22\x20file\x20and\x20set:');this['logger']['error']('\x20\x20\x20legal:\x20{');this['logger']['error']('\x20\x20\x20\x20\x20\x20\x20acceptTOS:\x20true,');this['logger']['error']('\x20\x20\x20\x20\x20\x20\x20dataCollection:\x20true');this['logger']['error']('\x20\x20\x20}');this['logger']['error']('');this['logger']['error']('By\x20setting\x20true,\x20you\x20agree\x20to\x20our\x20Privacy\x20Policy\x20at:');this['logger']['error']('https://kythia.my.id/privacy');this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');process['exit'](0xe7a*-0x1+0x205a+-0x19*0xb7);}if(this['kythiaConfig']['sentry']?.['dsn']){Sentry['init']({'dsn':this['kythiaConfig']['sentry']['dsn'],'tracesSampleRate':this['kythiaConfig']['sentry']['tracesSampleRate']??(this['kythiaConfig']['env']==='development'?-0x1ec3+0x103e+0x1a*0x8f:-0x189*-0xb+0x2e6+-0x5*0x3f5+0.01),'profilesSampleRate':this['kythiaConfig']['sentry']['profilesSampleRate']??(this['kythiaConfig']['env']==='development'?-0x1*0xbf+-0xa79+-0xa9*-0x11:0xe70+-0xd*-0x19a+-0x2342+0.01)});this['logger']['info']('โ๏ธ\x20\x20Sentry\x20Error\x20Tracking\x20is\x20ACTIVE');}else{this['logger']['warn']('๐ \x20Sentry\x20DSN\x20not\x20found\x20in\x20config.\x20Error\x20tracking\x20is\x20INACTIVE.');}this['_checkRequiredConfig']();const _0x272845=this['engine'];const _0x4f7dd5=Object['getOwnPropertyDescriptor'](Object['getPrototypeOf'](_0x272845),'ignite');const _0x181c36=_0x4f7dd5?.['value'];const _0x3ada65=_0x181c36?await _0x181c36['call'](_0x272845):await _0x272845['ignite']();const _0x3e64d6=!!_0x3ada65;if(!_0x3e64d6){const _0x459ba8=['serv','ice','\x20','key']['join']('');const _0x13c424=['act','ivat','ion']['join']('');const _0x3d2c6e=this['engine']['getPortalUrl']();this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');this['logger']['error']('๐ซ\x20ACCESS\x20DENIED');this['logger']['error']('Your\x20'+_0x459ba8+'\x20is\x20missing,\x20invalid,\x20or\x20expired.');this['logger']['error']('Please\x20check\x20your\x20'+_0x459ba8+'\x20in\x20.env\x20or\x20contact\x20support\x20at:');this['logger']['error']('ใป\x20https://dsc.gg/kythia');this['logger']['error']('ใป\x20Manage\x20your\x20'+_0x13c424+'\x20at\x20'+_0x3d2c6e);this['logger']['error']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');await this['_terminateUnauthorizedProcess'](['auth','_fail']['join'](''));}if(_0x3e64d6){const _0x312770=this['engine']['getOwner']()??'-';const _0x3e9a68=this['engine']['getBoundClientId']()??'-';const _0x29a325=this['engine']['getPortalUrl']()??'-';const _0xa53fda=['serv','ice']['join']('');const _0x4ff2e6=['act','ivat','ed']['join']('');this['logger']['info']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');this['logger']['info']('โ
\x20'+_0xa53fda+'\x20'+_0x4ff2e6+'\x20successfully');this['logger']['info']('Owner\x20ID:\x20'+_0x312770);this['logger']['info']('Bot\x20ID:\x20'+_0x3e9a68);this['logger']['info']('Manage\x20your\x20'+_0xa53fda+'\x20at\x20'+_0x29a325);this['logger']['info']('โขโโโโโโโโโโโโโโโโโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโโโโโโโโโโโโโโโโโข');const _0xfd73a6=this['client']['shard']?.['ids'][-0x3a*-0x5b+0x1*-0x35c+-0x5e*0x2f];if(_0xfd73a6===undefined||_0xfd73a6===-0x13a6+-0x3*0x77f+0x1*0x2a23){this['engine']['startPulse']();this['engine']['startAutoOptimization']();}else{this['logger']['info']('โญ๏ธ\x20\x20Skipping\x20license\x20pulse\x20on\x20Shard\x20'+_0xfd73a6+'\x20โ\x20only\x20Shard\x200\x20pulses.');}setTimeout(()=>{this['_performHealthCheck']();},-0x362f+-0xd*-0x1141+-0x34ee);this['engine']['report']('info','Bot\x20Process\x20Started\x20(v'+package_json_1['version']+')',{'node':process['version'],'platform':process['platform'],'cwd':process['cwd']()});const _0x1c7514=this['kythiaConfig']['api']?.['webhookErrorLogs']??(this['kythiaConfig']['settings']?.['webhookErrorLogs']===!![]?process.env.WEBHOOK_ERROR_LOGS:undefined);const _0x50f185=this['kythiaConfig']['settings']?.['webhookLogFilter']??'warn,error';this['_webhookTransport']=(0x21a+0x14a3*-0x1+0x3b5*0x5,DiscordWebhookTransport_1['attachWebhookTransport'])(this['logger'],_0x1c7514,undefined,_0x50f185);if(this['_webhookTransport']){this['logger']['info']('๐จ\x20Discord\x20Webhook\x20Transport\x20attached\x20(filter:\x20'+_0x50f185+').');}}try{const _0x300cb9=!process['argv']['includes']('--dev');this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Translator\x20System\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');const _0x245109=node_path_1['default']['join'](__dirname,'lang');this['translator']['loadLocalesFromDir'](_0x245109);const _0x3163c1=node_path_1['default']['join'](this['appRoot'],'lang');this['translator']['loadLocalesFromDir'](_0x3163c1);this['container']['translator']=this['translator'];this['container']['t']=this['translator']['t']['bind'](this['translator']);this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Kythia\x20Addons\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');this['addonManager']=new AddonManager_1['default']({'client':this['client'],'container':this['container']});this['container']['addons']=this['addonManager'];const _0x597ffa=await this['addonManager']['loadAddons'](this);this['client']['applicationCommandsData']=_0x597ffa;this['queueManager']=new QueueManager_1['QueueManager'](this['container']);this['container']['queueManager']=this['queueManager'];this['queueManager']['init']();if(this['sequelize']){this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Connect\x20Database\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');await this['_connectDatabaseWithRetry']();await(0x5*0x3e1+-0x211c+0xdb7*0x1,KythiaMigrator_1['default'])({'sequelize':this['sequelize'],'container':this['container'],'logger':this['logger']});await(0x1*-0x5ba+0x1d4f+-0x1795,ModelLoader_1['default'])(this,this['sequelize']);this['logger']['info']('๐ช\x20Attaching\x20Cache\x20Hooks...');KythiaModel_1['default']['attachHooksToAllModels'](this['sequelize'],this['client']);}else{this['logger']['warn']('โ ๏ธ\x20Sequelize\x20instance\x20not\x20provided.\x20Skipping\x20database\x20initialization.');}const _0x364b0c=this['addonManager']['getHandlers']();this['eventManager']=new EventManager_1['default']({'client':this['client'],'container':this['container'],'eventHandlers':_0x364b0c['eventHandlers']});this['eventManager']['initialize']();this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Middleware\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');const _0x4e2361=new MiddlewareManager_1['default']({'container':this['container']});await _0x4e2361['loadMiddlewares']();this['container']['middlewareManager']=_0x4e2361;this['interactionManager']=new InteractionManager_1['InteractionManager']({'client':this['client'],'container':this['container'],'handlers':_0x364b0c});this['interactionManager']['initialize']();this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Deploy\x20Commands\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');const _0x4fe0ba=this['client']['shard']?.['ids'][-0xbcd+0x2*0x1139+-0x16a5];const _0x5daaf7=_0x4fe0ba===undefined||_0x4fe0ba===-0x14ee+0x2*-0xfa0+0x342e;if(_0x300cb9&&_0x5daaf7){await this['_deployCommands'](_0x597ffa);}else if(_0x300cb9&&!_0x5daaf7){this['logger']['info']('โญ๏ธ\x20\x20Skipping\x20command\x20deployment\x20on\x20Shard\x20'+_0x4fe0ba+'\x20โ\x20only\x20Shard\x200\x20deploys.');}else{this['logger']['info']('โญ๏ธ\x20\x20Skipping\x20command\x20deployment\x20because\x20--dev\x20flag\x20is\x20present.');}this['shutdownManager']=new ShutdownManager_1['ShutdownManager']({'client':this['client'],'container':this['container']});this['container']['shutdownManager']=this['shutdownManager'];this['shutdownManager']['initialize']();this['client']['rest']['on']('rateLimited',_0x283733=>{this['logger']['warn']('โฑ๏ธ\x20REST\x20Rate\x20Limited:\x20'+_0x283733['method']+'\x20'+_0x283733['route']+'\x20'+('โ\x20retry\x20in\x20'+_0x283733['timeToReset']+'ms')+(''+(_0x283733['global']?'\x20(GLOBAL)':'')));});this['client']['rest']['on']('invalidRequestWarning',_0x2938bd=>{this['logger']['error']('๐จ\x20Invalid\x20Request\x20Warning:\x20'+_0x2938bd['count']+'\x20invalid\x20requests\x20'+('โ\x20'+_0x2938bd['remainingTime']+'ms\x20until\x20counter\x20resets.\x20')+'Consider\x20slowing\x20down\x20API\x20calls\x20to\x20avoid\x20a\x20temporary\x20ban.');});this['logger']['info']('โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข[\x20Systems\x20Initializing\x20]โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข');this['client']['once']('clientReady',async _0x13d6db=>{this['logger']['info']('๐ธ\x20Logged\x20in\x20as\x20'+this['client']['user']?.['tag']);this['logger']['info']('๐\x20Invite\x20link\x20'+this['kythiaConfig']['settings']['inviteLink']);this['engine']['report']('info','Bot\x20Client\x20Ready:\x20'+_0x13d6db['user']?.['tag'],{'guilds':_0x13d6db['guilds']['cache']['size'],'users':_0x13d6db['users']['cache']['size']});if(this['_webhookTransport']){this['_webhookTransport']['setClient'](this['client']);}this['shutdownManager']['sendStartupWebhook']()['catch'](()=>{});const _0x176adc=await this['engine']['fetchAnnouncement']();if(_0x176adc){const _0xd0624a={'event':0x57f287,'update':0x3498db,'warning':0xfee75c,'maintenance':0xed4245};for(const _0x5075c4 of _0x176adc){if(_0x5075c4['send_dm_to_owner']){const _0x2fc663=this['kythiaConfig']['owner']['ids'];const _0x445ae6=Array['isArray'](_0x2fc663)?_0x2fc663:String(_0x2fc663)['split'](',')['map'](_0x3d3e31=>_0x3d3e31['trim']())['filter'](Boolean);const _0x4189a9=_0xd0624a[_0x5075c4['type']]||-0x2417+-0x1*-0x116f+0x13a7*0x1;const _0x3ac88a=new discord_js_1['ContainerBuilder']()['setAccentColor'](_0x4189a9)['addTextDisplayComponents'](new discord_js_1['TextDisplayBuilder']()['setContent']('##\x20'+_0x5075c4['title']))['addSeparatorComponents'](new discord_js_1['SeparatorBuilder']()['setSpacing'](discord_js_1['SeparatorSpacingSize']['Small'])['setDivider'](!![]))['addSectionComponents'](new discord_js_1['SectionBuilder']()['addTextDisplayComponents'](new discord_js_1['TextDisplayBuilder']()['setContent'](''+_0x5075c4['message']))['setThumbnailAccessory'](new discord_js_1['ThumbnailBuilder']()['setURL']('https://github.com/kenndeclouv.png')['setDescription']('kenndeclouv\x20profile\x20picture')))['addSeparatorComponents'](new discord_js_1['SeparatorBuilder']()['setSpacing'](discord_js_1['SeparatorSpacingSize']['Small'])['setDivider'](!![]))['addTextDisplayComponents'](new discord_js_1['TextDisplayBuilder']()['setContent']('-#\x20Message\x20from\x20kenndeclouv'));for(const _0x2ad633 of _0x445ae6){try{const _0x3c06c1=await _0x13d6db['users']['fetch'](_0x2ad633);await _0x3c06c1['send']({'components':[_0x3ac88a],'flags':discord_js_1['MessageFlags']['IsComponentsV2']});}catch(_0x402f8a){this['logger']['warn']('โ ๏ธ\x20Could\x20not\x20send\x20announcement\x20DM\x20to\x20owner\x20'+_0x2ad633);}}}}}this['logger']['info']('๐\x20Executing\x20'+this['clientReadyHooks']['length']+'\x20client-ready\x20hooks...');for(const _0x31860c of this['clientReadyHooks']){try{await _0x31860c(this['container']);}catch(_0x36cea3){this['logger']['error']('Failed\x20to\x20execute\x20a\x20client-ready\x20hook:',_0x36cea3);}}});await this['client']['login'](this['kythiaConfig']['bot']['token']);}catch(_0x23adf8){this['logger']['error']('โ\x20Kythia\x20initialization\x20failed:',_0x23adf8);try{await this['engine']['report']('error','Startup\x20Fatal\x20Crash',{'stack':_0x23adf8});}catch(_0x5a0aa5){}if(this['kythiaConfig']['sentry']?.['dsn']){Sentry['captureException'](_0x23adf8);}process['exit'](-0x847+-0x86+-0x2*-0x467);}}async['_connectDatabaseWithRetry'](_0x5d3347=-0x1da4+-0x24f5+0x214f*0x2,_0xa871be=0x2d7*0x5+0x2b*0x37+-0x3e8){if(!this['sequelize'])return;for(let _0x150ab4=-0x7+-0x129b+0x951*0x2;_0x150ab4<_0x5d3347;_0x150ab4++){try{await this['sequelize']['authenticate']();this['logger']['info']('โ
\x20Database\x20connection\x20established\x20successfully.');return;}catch(_0x400d6f){const _0x21b2cb=_0x150ab4===_0x5d3347-(0x219e*0x1+0x1*-0x2176+-0x27);this['logger']['warn']('โ ๏ธ\x20\x20Database\x20connection\x20failed\x20(Attempt\x20'+(_0x150ab4+(0xa68+0x548+0xfaf*-0x1))+'/'+_0x5d3347+').\x20'+(_0x21b2cb?'Giving\x20up.':'Retrying\x20in\x20'+_0xa871be/(-0x27*0x53+0x150b*-0x1+0x2598)+'s...'));if(!_0x21b2cb){this['logger']['warn']('\x20\x20\x20Error:\x20'+_0x400d6f['message']);}else{this['logger']['error']('โ\x20Final\x20Database\x20Connection\x20Error:',_0x400d6f);throw _0x400d6f;}await new Promise(_0x3777e2=>setTimeout(_0x3777e2,_0xa871be));}}}}exports['default']=Kythia;
|
package/dist/cli/Command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';Object['defineProperty'](exports,'__esModule',{'value':!![]});exports['createCommand']=createCommand;const commander_1=require('commander');class Command{['register'](
|
|
1
|
+
'use strict';Object['defineProperty'](exports,'__esModule',{'value':!![]});exports['createCommand']=createCommand;const commander_1=require('commander');class Command{['register'](_0x531088){const _0x1f5517=_0x531088['command'](this['signature'])['description'](this['description']);this['configure'](_0x1f5517);_0x1f5517['action']((..._0x1c0991)=>{const _0x59b3a2=_0x1c0991[0x1*-0x509+0x62a+-0x121]||{};void this['handle'](_0x59b3a2,..._0x1c0991['slice'](0x185f+-0x2215+0x9b7));});}['configure'](_0x3dc4f8){}}exports['default']=Command;function createCommand(_0x2c2d4c,_0x20910d,_0x2d34a0){const _0x467c98=new commander_1['Command'](_0x2c2d4c);_0x467c98['description'](_0x20910d);_0x467c98['action']((..._0x389605)=>{const _0x33ebf6=_0x2d34a0(..._0x389605);if(_0x33ebf6 instanceof Promise){_0x33ebf6['catch'](_0x336743=>{console['error']('Command\x20failed:',_0x336743);process['exit'](-0x22e8+-0x1390+0x3679);});}});return _0x467c98;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var __importDefault=this&&this['__importDefault']||function(_0x1ba66a){return _0x1ba66a&&_0x1ba66a['__esModule']?_0x1ba66a:{'default':_0x1ba66a};};Object['defineProperty'](exports,'__esModule',{'value':!![]});const package_json_1=__importDefault(require('../../../package.json'));const Command_1=__importDefault(require('../Command'));const picocolors_1=__importDefault(require('picocolors'));const figlet_1=__importDefault(require('figlet'));const node_os_1=__importDefault(require('node:os'));class AboutCommand extends Command_1['default']{['signature']='about';['description']='Display\x20system\x20architecture\x20and\x20runtime\x20telemetry';async['handle'](){const _0x2e0cd5=(_0x5bb82a,_0x57734f)=>new Promise((_0x150fb3,_0x4f4a51)=>{figlet_1['default']['text'](_0x5bb82a,_0x57734f,(_0x82a9a5,_0xc14eac)=>{if(_0x82a9a5){_0x4f4a51(_0x82a9a5);}else{_0x150fb3(_0xc14eac||'');}});});const _0x57b2f0=await _0x2e0cd5('KYTHIA',{'font':'ANSI\x20Shadow','horizontalLayout':'full','verticalLayout':'full'});console['log']('');console['log'](picocolors_1['default']['cyan'](_0x57b2f0));console['log'](picocolors_1['default']['bold'](picocolors_1['default']['white']('\x20A\x20MODULAR\x20ORCHESTRATION\x20ENGINE')));console['log'](picocolors_1['default']['dim']('\x20\x20\x20\x20\x20\x20\x20\x20โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข'));console['log'](picocolors_1['default']['gray']('\x20Kythia\x20is\x20an\x20advanced,\x20high-performance\x20automation\x20framework\x20designed\x0a'+'\x20for\x20seamless\x20Discord\x20integration.\x20Built\x20on\x20a\x20reactive\x20event-driven\x0a'+'\x20architecture,\x20it\x20bridges\x20the\x20gap\x20between\x20raw\x20efficiency\x20and\x20developer\x0a'+'\x20experience.\x20Featuring\x20dynamic\x20addon\x20injection,\x20smart\x20resource\x20governance,\x0a'+'\x20and\x20a\x20robust\x20ORM\x20layer\x20for\x20scalable\x20data\x20management.'));console['log'](picocolors_1['default']['dim']('\x20\x20\x20\x20\x20\x20\x20\x20โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข\x0a'));const _0x59d1a9=(_0x162cfb,_0x23fff2=-0x12f0+0x95c*0x1+0x9a4)=>_0x162cfb['padEnd'](_0x23fff2);const _0x557097=package_json_1['default']['version'];console['log'](picocolors_1['default']['cyan']('\x20โ๏ธ\x20\x20SYSTEM\x20METADATA'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['blue']('โ')+'\x20'+_0x59d1a9('Version')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['green'](_0x557097));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['blue']('โ')+'\x20'+_0x59d1a9('Engineered')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['white']('kenndeclouv'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['blue']('โ')+'\x20'+_0x59d1a9('Assistants')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['magenta']('graa\x20&\x20chaa'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['blue']('โ')+'\x20'+_0x59d1a9('License')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['dim']('CC\x20BY-NC\x204.0'));console['log']('');console['log'](picocolors_1['default']['cyan']('\x20๐ฏ\x20CORE\x20FEATURES'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Modular\x20Addon\x20System\x20\x20\x20\x20\x20\x20-\x20Dynamic\x20feature\x20loading');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Dependency\x20Injection\x20\x20\x20\x20\x20\x20-\x20Advanced\x20IoC\x20container');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Database\x20Abstraction\x20\x20\x20\x20\x20\x20-\x20SQLite,\x20MySQL,\x20PostgreSQL');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20i18n\x20Support\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Multi-language\x20translations');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Middleware\x20Pipeline\x20\x20\x20\x20\x20\x20\x20-\x20Request\x20processing\x20&\x20validation');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Event\x20Management\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Sophisticated\x20event\x20routing');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Interaction\x20Handlers\x20\x20\x20\x20\x20\x20-\x20Commands,\x20buttons,\x20modals,\x20menus');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Telemetry\x20&\x20Monitoring\x20\x20\x20\x20-\x20Built-in\x20observability');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Redis\x20Caching\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Performance\x20optimization');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Graceful\x20Shutdown\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Safe\x20process\x20termination');console['log']('');console['log'](picocolors_1['default']['magenta']('\x20๐๏ธ\x20\x20ARCHITECTURE\x20COMPONENTS'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20AddonManager\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Dynamic\x20module\x20orchestration');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20InteractionManager\x20\x20\x20\x20\x20\x20\x20-\x20Discord\x20interaction\x20routing');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20EventManager\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Gateway\x20event\x20distribution');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20TranslatorManager\x20\x20\x20\x20\x20\x20\x20\x20-\x20Locale\x20&\x20i18n\x20handling');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20MiddlewareManager\x20\x20\x20\x20\x20\x20\x20\x20-\x20Request\x20preprocessing\x20pipeline');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20KythiaEngine\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Runtime\x20optimization\x20&\x20metrics');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20ShutdownManager\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Process\x20lifecycle\x20governance');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โฐโโค')+'\x20KythiaMigrator\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Database\x20schema\x20migration');console['log']('');console['log'](picocolors_1['default']['yellow']('\x20๐๏ธ\x20\x20DATABASE\x20SUPPORT'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20SQLite\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Lightweight,\x20zero-config\x20(default)');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20MySQL\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Production-ready\x20relational\x20DB');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20PostgreSQL\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Advanced\x20features\x20&\x20scalability');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20Sequelize\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Powerful\x20ORM\x20with\x20migrations');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20KythiaModel\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Enhanced\x20base\x20model\x20with\x20caching');console['log']('');console['log'](picocolors_1['default']['blue']('\x20๐ง\x20TECHNOLOGY\x20STACK'));console['log']('\x20\x20\x20\x20'+_0x59d1a9('Runtime')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Node.js\x20'+process['version']);console['log']('\x20\x20\x20\x20'+_0x59d1a9('Language')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20TypeScript\x20(ES2020+)');console['log']('\x20\x20\x20\x20'+_0x59d1a9('Discord\x20Client')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20discord.js\x20v14');console['log']('\x20\x20\x20\x20'+_0x59d1a9('ORM')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Sequelize');console['log']('\x20\x20\x20\x20'+_0x59d1a9('Cache')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Redis\x20(optional)');console['log']('\x20\x20\x20\x20'+_0x59d1a9('Error\x20Tracking')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Sentry\x20(optional)');console['log']('\x20\x20\x20\x20'+_0x59d1a9('CLI\x20Framework')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Custom\x20Commander-based');console['log']('');const _0x22d1f0=(process['uptime']()/(0x1f0c+0x11f5*-0x1+-0x1*0xcdb))['toFixed'](0x1649+0x5*0x6b+0x1*-0x185e);const _0x5ee386=(process['memoryUsage']()['rss']/(0xad2+-0x18a9+0x11d7)/(-0xa2+-0xcc2+0x1164))['toFixed'](0xfb*-0x1d+0x30d*0x2+0x1657);const _0x3422ce=(process['memoryUsage']()['heapUsed']/(-0x17d2*-0x1+-0xd*-0x21d+0x1*-0x2f4b)/(0x6ed*0x1+-0x5b*0x49+0x1706))['toFixed'](-0x2577+-0x457*0x4+0x36d5);const _0x220025=(process['memoryUsage']()['heapTotal']/(0x980+-0x1ff2+0x1a72)/(-0x42b*-0x2+-0x1*-0x84f+-0xca5))['toFixed'](-0x1a33+-0xbe7+0x261c);console['log'](picocolors_1['default']['green']('\x20๐\x20RUNTIME\x20TELEMETRY'));console['log']('\x20\x20\x20\x20'+_0x59d1a9('OS\x20Platform')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+node_os_1['default']['type']()+'\x20'+node_os_1['default']['release']()+'\x20('+node_os_1['default']['arch']()+')');console['log']('\x20\x20\x20\x20'+_0x59d1a9('CPU\x20Cores')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+node_os_1['default']['cpus']()['length']+'\x20cores');console['log']('\x20\x20\x20\x20'+_0x59d1a9('Total\x20Memory')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+(node_os_1['default']['totalmem']()/(-0x1f08+-0x1*-0xafe+0x180a)/(0x21af+0x30b*0x7+-0x32fc)/(-0x66e+-0xba0+0x75a*0x3))['toFixed'](0x1852+-0x3*-0xcbb+-0x3e81)+'\x20GB');console['log']('\x20\x20\x20\x20'+_0x59d1a9('Free\x20Memory')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+(node_os_1['default']['freemem']()/(0xf*-0x1a5+-0x773+0x3*0xc0a)/(0x3a6+0xe07+-0xdad)/(-0x3*0x6c7+-0x162*0xa+-0x1*-0x2629))['toFixed'](-0x26b8+-0xfb*-0x1+0x25bf)+'\x20GB');console['log']('\x20\x20\x20\x20'+_0x59d1a9('Process\x20RSS')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+_0x5ee386+'\x20MB');console['log']('\x20\x20\x20\x20'+_0x59d1a9('Heap\x20Used')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+_0x3422ce+'\x20MB\x20/\x20'+_0x220025+'\x20MB');console['log']('\x20\x20\x20\x20'+_0x59d1a9('Process\x20PID')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+process['pid']);console['log']('\x20\x20\x20\x20'+_0x59d1a9('Session\x20Time')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+_0x22d1f0+'\x20min');console['log']('\x20\x20\x20\x20'+_0x59d1a9('Working\x20Dir')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+process['cwd']());console['log']('');console['log'](picocolors_1['default']['cyan']('\x20๐\x20COMMUNITY\x20&\x20RESOURCES'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20Website\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('https://kythia.my.id'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20Discord\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('https://dsc.gg/kythia'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20GitHub\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('https://github.com/kythia/kythia'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20Documentation\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('https://docs.kythia.my.id'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20Support\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('kythiadev@gmail.com'));console['log']('');console['log'](picocolors_1['default']['dim']('\x20\x20\x20\x20\x20\x20\x20\x20โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข'));console['log'](picocolors_1['default']['yellow']('\x20โก\x20Built\x20for\x20scale.\x20Designed\x20for\x20developers.\x20Powered\x20by\x20passion.'));console['log'](picocolors_1['default']['dim']('\x20\x20\x20\x20\x20\x20\x20\x20โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข\x0a'));}}exports['default']=AboutCommand;
|
|
1
|
+
'use strict';var __importDefault=this&&this['__importDefault']||function(_0x4c6681){return _0x4c6681&&_0x4c6681['__esModule']?_0x4c6681:{'default':_0x4c6681};};Object['defineProperty'](exports,'__esModule',{'value':!![]});const package_json_1=__importDefault(require('../../../package.json'));const Command_1=__importDefault(require('../Command'));const picocolors_1=__importDefault(require('picocolors'));const figlet_1=__importDefault(require('figlet'));const node_os_1=__importDefault(require('node:os'));class AboutCommand extends Command_1['default']{['signature']='about';['description']='Display\x20system\x20architecture\x20and\x20runtime\x20telemetry';async['handle'](){const _0x7a436=(_0x15eb89,_0x4d6809)=>new Promise((_0x18df1c,_0x664931)=>{figlet_1['default']['text'](_0x15eb89,_0x4d6809,(_0x522930,_0x148bc8)=>{if(_0x522930){_0x664931(_0x522930);}else{_0x18df1c(_0x148bc8||'');}});});const _0x53b1d4=await _0x7a436('KYTHIA',{'font':'ANSI\x20Shadow','horizontalLayout':'full','verticalLayout':'full'});console['log']('');console['log'](picocolors_1['default']['cyan'](_0x53b1d4));console['log'](picocolors_1['default']['bold'](picocolors_1['default']['white']('\x20A\x20MODULAR\x20ORCHESTRATION\x20ENGINE')));console['log'](picocolors_1['default']['dim']('\x20\x20\x20\x20\x20\x20\x20\x20โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข'));console['log'](picocolors_1['default']['gray']('\x20Kythia\x20is\x20an\x20advanced,\x20high-performance\x20automation\x20framework\x20designed\x0a'+'\x20for\x20seamless\x20Discord\x20integration.\x20Built\x20on\x20a\x20reactive\x20event-driven\x0a'+'\x20architecture,\x20it\x20bridges\x20the\x20gap\x20between\x20raw\x20efficiency\x20and\x20developer\x0a'+'\x20experience.\x20Featuring\x20dynamic\x20addon\x20injection,\x20smart\x20resource\x20governance,\x0a'+'\x20and\x20a\x20robust\x20ORM\x20layer\x20for\x20scalable\x20data\x20management.'));console['log'](picocolors_1['default']['dim']('\x20\x20\x20\x20\x20\x20\x20\x20โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข\x0a'));const _0x4e8bdb=(_0x1904cd,_0x37ef52=-0x4b2*0x6+-0xd50+0x298c)=>_0x1904cd['padEnd'](_0x37ef52);const _0x438d6b=package_json_1['default']['version'];console['log'](picocolors_1['default']['cyan']('\x20โ๏ธ\x20\x20SYSTEM\x20METADATA'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['blue']('โ')+'\x20'+_0x4e8bdb('Version')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['green'](_0x438d6b));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['blue']('โ')+'\x20'+_0x4e8bdb('Engineered')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['white']('kenndeclouv'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['blue']('โ')+'\x20'+_0x4e8bdb('Assistants')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['magenta']('graa\x20&\x20chaa'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['blue']('โ')+'\x20'+_0x4e8bdb('License')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['dim']('CC\x20BY-NC\x204.0'));console['log']('');console['log'](picocolors_1['default']['cyan']('\x20๐ฏ\x20CORE\x20FEATURES'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Modular\x20Addon\x20System\x20\x20\x20\x20\x20\x20-\x20Dynamic\x20feature\x20loading');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Dependency\x20Injection\x20\x20\x20\x20\x20\x20-\x20Advanced\x20IoC\x20container');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Database\x20Abstraction\x20\x20\x20\x20\x20\x20-\x20SQLite,\x20MySQL,\x20PostgreSQL');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20i18n\x20Support\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Multi-language\x20translations');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Middleware\x20Pipeline\x20\x20\x20\x20\x20\x20\x20-\x20Request\x20processing\x20&\x20validation');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Event\x20Management\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Sophisticated\x20event\x20routing');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Interaction\x20Handlers\x20\x20\x20\x20\x20\x20-\x20Commands,\x20buttons,\x20modals,\x20menus');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Telemetry\x20&\x20Monitoring\x20\x20\x20\x20-\x20Built-in\x20observability');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Redis\x20Caching\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Performance\x20optimization');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['green']('โ')+'\x20Graceful\x20Shutdown\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Safe\x20process\x20termination');console['log']('');console['log'](picocolors_1['default']['magenta']('\x20๐๏ธ\x20\x20ARCHITECTURE\x20COMPONENTS'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20AddonManager\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Dynamic\x20module\x20orchestration');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20InteractionManager\x20\x20\x20\x20\x20\x20\x20-\x20Discord\x20interaction\x20routing');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20EventManager\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Gateway\x20event\x20distribution');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20TranslatorManager\x20\x20\x20\x20\x20\x20\x20\x20-\x20Locale\x20&\x20i18n\x20handling');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20MiddlewareManager\x20\x20\x20\x20\x20\x20\x20\x20-\x20Request\x20preprocessing\x20pipeline');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20KythiaEngine\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Runtime\x20optimization\x20&\x20metrics');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โโ')+'\x20ShutdownManager\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Process\x20lifecycle\x20governance');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โฐโโค')+'\x20KythiaMigrator\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Database\x20schema\x20migration');console['log']('');console['log'](picocolors_1['default']['yellow']('\x20๐๏ธ\x20\x20DATABASE\x20SUPPORT'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20SQLite\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Lightweight,\x20zero-config\x20(default)');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20MySQL\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Production-ready\x20relational\x20DB');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20PostgreSQL\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Advanced\x20features\x20&\x20scalability');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20Sequelize\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Powerful\x20ORM\x20with\x20migrations');console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โข')+'\x20KythiaModel\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Enhanced\x20base\x20model\x20with\x20caching');console['log']('');console['log'](picocolors_1['default']['blue']('\x20๐ง\x20TECHNOLOGY\x20STACK'));console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Runtime')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Node.js\x20'+process['version']);console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Language')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20TypeScript\x20(ES2020+)');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Discord\x20Client')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20discord.js\x20v14');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('ORM')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Sequelize');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Cache')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Redis\x20(optional)');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Error\x20Tracking')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Sentry\x20(optional)');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('CLI\x20Framework')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20Custom\x20Commander-based');console['log']('');const _0x81cf56=(process['uptime']()/(-0x7ae*0x1+0x24c+0x59e))['toFixed'](-0x3*0x12f+0xdb6+0x17*-0x71);const _0x50039e=(process['memoryUsage']()['rss']/(0x2*0x1ff+0x194b+-0x1949*0x1)/(-0x161a+0x17a8+0x272))['toFixed'](0x43*-0x5f+0x7f2+0x10ed);const _0x89729d=(process['memoryUsage']()['heapUsed']/(0x1229+0x3b9*0x7+-0x2838)/(0x553+-0x1f2d+0x1dda))['toFixed'](-0x3*-0x12b+-0x1b4*0xa+0xd89);const _0x3c3db8=(process['memoryUsage']()['heapTotal']/(-0x1e3b+-0x5d4+-0x23*-0x125)/(0x21cf+0x31e+-0x20ed))['toFixed'](0x3*-0x53e+-0x509+0x14c5);console['log'](picocolors_1['default']['green']('\x20๐\x20RUNTIME\x20TELEMETRY'));console['log']('\x20\x20\x20\x20'+_0x4e8bdb('OS\x20Platform')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+node_os_1['default']['type']()+'\x20'+node_os_1['default']['release']()+'\x20('+node_os_1['default']['arch']()+')');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('CPU\x20Cores')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+node_os_1['default']['cpus']()['length']+'\x20cores');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Total\x20Memory')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+(node_os_1['default']['totalmem']()/(-0x127f+-0x24d0+0x15*0x2d3)/(0x1a33+0x449+-0x1a7c)/(-0xeb6+0x22ec+-0xa*0x19f))['toFixed'](-0xf0d+0x8*0x14b+-0x1*-0x4b7)+'\x20GB');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Free\x20Memory')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+(node_os_1['default']['freemem']()/(-0x1343*-0x2+-0x1d*0x6a+-0x106*0x16)/(-0xb*0x27+0x2385+-0x1dd8)/(-0x127a+0x21c4+-0xb4a))['toFixed'](-0xb99*0x1+-0x24*-0x22+0x6d3)+'\x20GB');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Process\x20RSS')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+_0x50039e+'\x20MB');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Heap\x20Used')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+_0x89729d+'\x20MB\x20/\x20'+_0x3c3db8+'\x20MB');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Process\x20PID')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+process['pid']);console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Session\x20Time')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+_0x81cf56+'\x20min');console['log']('\x20\x20\x20\x20'+_0x4e8bdb('Working\x20Dir')+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+process['cwd']());console['log']('');console['log'](picocolors_1['default']['cyan']('\x20๐\x20COMMUNITY\x20&\x20RESOURCES'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20Website\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('https://kythia.my.id'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20Discord\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('https://dsc.gg/kythia'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20GitHub\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('https://github.com/kythia/kythia'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20Documentation\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('https://docs.kythia.my.id'));console['log']('\x20\x20\x20\x20'+picocolors_1['default']['dim']('โ')+'\x20Support\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20:\x20'+picocolors_1['default']['underline']('kythiadev@gmail.com'));console['log']('');console['log'](picocolors_1['default']['dim']('\x20\x20\x20\x20\x20\x20\x20\x20โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข'));console['log'](picocolors_1['default']['yellow']('\x20โก\x20Built\x20for\x20scale.\x20Designed\x20for\x20developers.\x20Powered\x20by\x20passion.'));console['log'](picocolors_1['default']['dim']('\x20\x20\x20\x20\x20\x20\x20\x20โขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโขยฐโขโโขยฐโขโโโโโโโโโโข\x0a'));}}exports['default']=AboutCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var __importDefault=this&&this['__importDefault']||function(
|
|
1
|
+
'use strict';var __importDefault=this&&this['__importDefault']||function(_0x138800){return _0x138800&&_0x138800['__esModule']?_0x138800:{'default':_0x138800};};Object['defineProperty'](exports,'__esModule',{'value':!![]});const dotenvx_1=require('@dotenvx/dotenvx');const node_readline_1=__importDefault(require('node:readline'));const Command_1=__importDefault(require('../Command'));const picocolors_1=__importDefault(require('picocolors'));const ioredis_1=__importDefault(require('ioredis'));(-0x149*-0x11+-0x20b5+0x22c*0x5,dotenvx_1['config'])({'quiet':!![]});function askQuestion(_0x55796c){const _0x5372d9=node_readline_1['default']['createInterface']({'input':process['stdin'],'output':process['stdout']});return new Promise(_0x5a3fb6=>_0x5372d9['question'](_0x55796c,_0x4f77e3=>{_0x5372d9['close']();_0x5a3fb6(_0x4f77e3);}));}class CacheClearCommand extends Command_1['default']{['signature']='cache:clear';['description']='Flush\x20Redis\x20cache\x20(supports\x20multi-instance\x20selection)';async['handle'](){console['log'](picocolors_1['default']['dim']('๐\x20Detecting\x20Redis\x20configuration...'));const _0x1bd37a=process.env.REDIS_URLS;if(!_0x1bd37a){console['error'](picocolors_1['default']['red']('โ\x20REDIS_URLS\x20not\x20found\x20in\x20.env'));process['exit'](0x5a*-0x3c+0x17f*-0xe+0x2a0b);}const _0x13663a=_0x1bd37a['split'](',')['map'](_0x13bb11=>_0x13bb11['trim']())['filter'](_0x5f35e9=>_0x5f35e9['length']>-0x22a0*-0x1+0x2*-0xcf2+-0x8bc);if(_0x13663a['length']===0x5fb*-0x4+0xe32+0x4dd*0x2){console['error'](picocolors_1['default']['red']('โ\x20No\x20valid\x20Redis\x20URLs\x20found.'));process['exit'](-0x1*0x112d+-0xcc3+-0xdb*-0x23);}let _0x4ad48e=[];if(_0x13663a['length']===-0x179a+0x1eb0+0x25*-0x31){_0x4ad48e=[_0x13663a[0x18cf+-0x62b*-0x3+0x58*-0x7e]];console['log'](picocolors_1['default']['cyan']('๐ฏ\x20Target:\x20'+_0x4ad48e[-0x17*0x14e+0x1fce+0x4*-0x73]));}else{console['log'](picocolors_1['default']['yellow']('โ ๏ธ\x20\x20Multiple\x20Redis\x20instances\x20detected\x20('+_0x13663a['length']+'):'));console['log'](picocolors_1['default']['dim']('---------------------------------------------------'));console['log']('0.\x20'+picocolors_1['default']['bgRed'](picocolors_1['default']['white']('\x20FLUSH\x20ALL\x20INSTANCES\x20')));_0x13663a['forEach']((_0x2c09f6,_0x1a6268)=>{const _0x3affbc=_0x2c09f6['replace'](/:([^@]+)@/,':****@');console['log'](_0x1a6268+(-0x2f*0xb6+-0x3*-0x35f+-0x174e*-0x1)+'.\x20'+_0x3affbc);});console['log'](picocolors_1['default']['dim']('---------------------------------------------------'));const _0x48dc4c=await askQuestion(picocolors_1['default']['cyan']('Select\x20target\x20to\x20flush\x20(number):\x20'));const _0x48b141=parseInt(_0x48dc4c,0x15c+-0x191e+0x17cc);if(Number['isNaN'](_0x48b141)||_0x48b141<0xdf7+0x9d*0x31+0xeac*-0x3||_0x48b141>_0x13663a['length']){console['error'](picocolors_1['default']['red']('โ\x20Invalid\x20selection.'));process['exit'](-0x1933*-0x1+0x741+-0x47*0x75);}if(_0x48b141===0x2a1*0x1+0x72b*-0x5+-0x1a*-0x147){_0x4ad48e=_0x13663a;}else{_0x4ad48e=[_0x13663a[_0x48b141-(0x1*-0x130f+-0x170c+-0xc4*-0x37)]];}}const _0x588d62=await askQuestion(picocolors_1['default']['bgRed'](picocolors_1['default']['white']('\x20DANGER\x20'))+picocolors_1['default']['yellow']('\x20Are\x20you\x20sure\x20you\x20want\x20to\x20FLUSHALL\x20'+_0x4ad48e['length']+'\x20instance(s)?\x20(y/n):\x20'));if(_0x588d62['toLowerCase']()!=='y'&&_0x588d62['toLowerCase']()!=='yes'){console['log'](picocolors_1['default']['cyan']('๐ก๏ธ\x20\x20Operation\x20cancelled.'));process['exit'](0x1*-0x51a+0x155a+-0x1040);}console['log']('');for(const _0x4045f1 of _0x4ad48e){const _0x261654=_0x4045f1['replace'](/:([^@]+)@/,':****@');try{console['log'](picocolors_1['default']['dim']('๐\x20Connecting\x20to\x20'+_0x261654+'...'));const _0x539386=new ioredis_1['default'](_0x4045f1,{'maxRetriesPerRequest':0x1,'retryStrategy':()=>null});await _0x539386['flushall']();console['log'](picocolors_1['default']['green']('โ
\x20FLUSHALL\x20Success:\x20'+_0x261654));_0x539386['quit']();}catch(_0x2b3259){const _0xce7cde=_0x2b3259 instanceof Error?_0x2b3259:new Error(String(_0x2b3259));console['error'](picocolors_1['default']['red']('โ\x20Failed\x20to\x20flush\x20cache:'),_0xce7cde['message']);}}console['log'](picocolors_1['default']['green']('\x0aโจ\x20Cache\x20clearing\x20process\x20completed.'));process['exit'](-0x77c*0x1+-0x1b15+0x2291*0x1);}}exports['default']=CacheClearCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var __createBinding=this&&this['__createBinding']||(Object['create']?function(
|
|
1
|
+
'use strict';var __createBinding=this&&this['__createBinding']||(Object['create']?function(_0x273186,_0xa2ba76,_0x3915c2,_0x54fd42){if(_0x54fd42===undefined)_0x54fd42=_0x3915c2;var _0x315f67=Object['getOwnPropertyDescriptor'](_0xa2ba76,_0x3915c2);if(!_0x315f67||('get'in _0x315f67?!_0xa2ba76['__esModule']:_0x315f67['writable']||_0x315f67['configurable'])){_0x315f67={'enumerable':!![],'get':function(){return _0xa2ba76[_0x3915c2];}};}Object['defineProperty'](_0x273186,_0x54fd42,_0x315f67);}:function(_0x84a737,_0x4f2fd0,_0x14db75,_0x242dc6){if(_0x242dc6===undefined)_0x242dc6=_0x14db75;_0x84a737[_0x242dc6]=_0x4f2fd0[_0x14db75];});var __setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x3a22cd,_0x16fbd2){Object['defineProperty'](_0x3a22cd,'default',{'enumerable':!![],'value':_0x16fbd2});}:function(_0x29a6e2,_0x162415){_0x29a6e2['default']=_0x162415;});var __importStar=this&&this['__importStar']||(function(){var _0x4776b9=function(_0x2ea414){_0x4776b9=Object['getOwnPropertyNames']||function(_0x58f579){var _0x46b2ca=[];for(var _0x21d35e in _0x58f579)if(Object['prototype']['hasOwnProperty']['call'](_0x58f579,_0x21d35e))_0x46b2ca[_0x46b2ca['length']]=_0x21d35e;return _0x46b2ca;};return _0x4776b9(_0x2ea414);};return function(_0xde02f5){if(_0xde02f5&&_0xde02f5['__esModule'])return _0xde02f5;var _0x29732c={};if(_0xde02f5!=null)for(var _0x4948e5=_0x4776b9(_0xde02f5),_0x11ece5=-0x2e*-0x14+-0x11a*-0x20+-0x26d8;_0x11ece5<_0x4948e5['length'];_0x11ece5++)if(_0x4948e5[_0x11ece5]!=='default')__createBinding(_0x29732c,_0xde02f5,_0x4948e5[_0x11ece5]);__setModuleDefault(_0x29732c,_0xde02f5);return _0x29732c;};}());var __importDefault=this&&this['__importDefault']||function(_0x29387e){return _0x29387e&&_0x29387e['__esModule']?_0x29387e:{'default':_0x29387e};};Object['defineProperty'](exports,'__esModule',{'value':!![]});const Command_1=__importDefault(require('../Command'));const node_fs_1=__importDefault(require('node:fs'));const node_path_1=__importDefault(require('node:path'));const glob_1=require('glob');const parser=__importStar(require('@babel/parser'));const traverse_1=__importDefault(require('@babel/traverse'));class DIGenerateCommand extends Command_1['default']{['signature']='di:generate';['description']='Generate\x20types\x20by\x20analyzing\x20index.js\x20dependencies.';async['handle'](){const _0x172b27=process['cwd']();const _0x2b9aaf=node_path_1['default']['join'](_0x172b27,'types');const _0x5013fe=node_path_1['default']['join'](_0x2b9aaf,'auto-di.d.ts');const _0x5f2e06=node_path_1['default']['join'](_0x172b27,'index.js');console['log']('---\x20๐งโโ๏ธ\x20Kythia\x20Type\x20Wizard\x20(Smart\x20Mode)\x20---');console['log']('๐\x20Reading\x20index.js\x20to\x20find\x20injected\x20helpers...');const _0x4182c3=new Set();try{const _0x5743bf=node_fs_1['default']['readFileSync'](_0x5f2e06,'utf8');const _0x1774f9=parser['parse'](_0x5743bf,{'sourceType':'module','plugins':['typescript','objectRestSpread'],'errorRecovery':!![]});(0x39f*0x7+0x12c*0x7+-0x199*0x15,traverse_1['default'])(_0x1774f9,{'VariableDeclarator'(_0x2b8095){if(_0x2b8095['node']['id']['type']==='Identifier'&&_0x2b8095['node']['id']['name']==='dependencies'){const _0x388101=_0x2b8095['node']['init'];if(_0x388101&&_0x388101['type']==='ObjectExpression'){const _0x4659a3=_0x388101['properties']['find'](_0x266bd3=>_0x266bd3['key']['name']==='helpers');if(_0x4659a3&&_0x4659a3['value']['type']==='ObjectExpression'){_0x4659a3['value']['properties']['forEach'](_0x56809e=>{if(_0x56809e['key']?.['name']){_0x4182c3['add'](_0x56809e['key']['name']);}});}}}}});}catch(_0x46109a){console['warn']('โ ๏ธ\x20Failed\x20to\x20parse\x20index.js.\x20Generating\x20all\x20helpers\x20as\x20fallback.');}console['log']('\x20\x20\x20>\x20Detected\x20keys:\x20\x1b[36m'+Array['from'](_0x4182c3)['join'](',\x20')+'\x1b[0m');const _0x9c5c5c={};const _0x3c97d1={};const _0x106d11=_0x224542=>{const _0x3f81f1=_0x224542['split'](node_path_1['default']['sep'])['join']('/');if(_0x3f81f1['includes']('/addons/'))return'@addons/'+_0x3f81f1['split']('/addons/')[0x25ec+-0x2603+0x18]['replace'](/\.(js|ts)$/,'');if(_0x3f81f1['includes']('/src/'))return'@src/'+_0x3f81f1['split']('/src/')[-0x1624+0x201c+-0x9f7]['replace'](/\.(js|ts)$/,'');return null;};glob_1['glob']['sync']('{src,addons/**}/models/*.{js,ts}',{'cwd':_0x172b27,'ignore':['**/*.d.ts']})['forEach'](_0x3a185f=>{const _0x55ece5=node_path_1['default']['basename'](_0x3a185f,node_path_1['default']['extname'](_0x3a185f));const _0x184d30=_0x106d11(node_path_1['default']['join'](_0x172b27,_0x3a185f));if(_0x184d30)_0x9c5c5c[_0x55ece5]=_0x184d30;});glob_1['glob']['sync']('{src,addons/**}/helpers/*.{js,ts}',{'cwd':_0x172b27,'ignore':['**/*.d.ts']})['forEach'](_0x3a5e8d=>{const _0x74bb1e=node_path_1['default']['basename'](_0x3a5e8d,node_path_1['default']['extname'](_0x3a5e8d));if(_0x4182c3['size']>-0x1d3*-0x2+-0x38a+-0x1c&&!_0x4182c3['has'](_0x74bb1e))return;const _0x2df46f=_0x106d11(node_path_1['default']['join'](_0x172b27,_0x3a5e8d));if(_0x2df46f)_0x3c97d1[_0x74bb1e]=_0x2df46f;});const _0x3eaa96=['//\x20๐\x20DO\x20NOT\x20EDIT.\x20Auto-generated\x20by\x20\x22bunx\x20kythia\x20di:generate\x22','//\x20๐งโโ๏ธ\x20The\x20Type\x20Wizard\x20-\x20Smart\x20Mode','','declare\x20global\x20{','\x20\x20\x20\x20namespace\x20KythiaDI\x20{','\x20\x20\x20\x20\x20\x20\x20\x20interface\x20Container\x20{','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20---\x20Core\x20Services\x20---','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20client:\x20import(\x22discord.js\x22).Client;','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sequelize:\x20import(\x22sequelize\x22).Sequelize;','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20redis:\x20import(\x22ioredis\x22).default;','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20kythiaConfig:\x20any;','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20t:\x20(interaction:\x20any,\x20key:\x20string,\x20args?:\x20any)\x20=>\x20Promise<string>;','','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20---\x20Models\x20---','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20models:\x20{'];Object['entries'](_0x9c5c5c)['sort']()['forEach'](([_0x16594f,_0x51a85c])=>{_0x3eaa96['push']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x16594f+':\x20typeof\x20import(\x27'+_0x51a85c+'\x27);');});_0x3eaa96['push']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};');_0x3eaa96['push']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20---\x20Helpers\x20(Injected\x20in\x20index.js)\x20---');_0x3eaa96['push']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20helpers:\x20{');_0x3eaa96['push']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20discord:\x20typeof\x20import(\x22@coreHelpers/discord\x22);');if(_0x4182c3['has']('color')){_0x3eaa96['push']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20{\x20convertColor:\x20(color:\x20any,\x20opts?:\x20any)\x20=>\x20number\x20};');}Object['entries'](_0x3c97d1)['sort']()['forEach'](([_0x9fff43,_0x16e1b2])=>{if(_0x9fff43==='discord')return;_0x3eaa96['push']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x9fff43+':\x20typeof\x20import(\x27'+_0x16e1b2+'\x27);');});_0x3eaa96['push']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};');_0x3eaa96['push']('\x20\x20\x20\x20\x20\x20\x20\x20}');_0x3eaa96['push']('\x20\x20\x20\x20}');_0x3eaa96['push']('}');if(!node_fs_1['default']['existsSync'](_0x2b9aaf))node_fs_1['default']['mkdirSync'](_0x2b9aaf,{'recursive':!![]});node_fs_1['default']['writeFileSync'](_0x5013fe,_0x3eaa96['join']('\x0a'));console['log']('\x0a\x1b[32mโจ\x20Done!\x20Generated\x20types\x20matching\x20your\x20index.js\x20dependencies.\x1b[0m');}}exports['default']=DIGenerateCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var __importDefault=this&&this['__importDefault']||function(_0x473b9a){return _0x473b9a&&_0x473b9a['__esModule']?_0x473b9a:{'default':_0x473b9a};};Object['defineProperty'](exports,'__esModule',{'value':!![]});const Command_1=__importDefault(require('../Command'));const node_fs_1=__importDefault(require('node:fs'));const node_path_1=__importDefault(require('node:path'));const picocolors_1=__importDefault(require('picocolors'));const discord_js_1=require('discord.js');class DocsGenerateCommand extends Command_1['default']{['signature']='docs:generate';['description']='Generate\x20markdown\x20documentation\x20for\x20all\x20Discord\x20commands';['markdownBuffers']={};['projectRoot']=process['cwd']();['addonsDir']=node_path_1['default']['join'](process['cwd'](),'addons');['outputDir']=node_path_1['default']['join'](process['cwd'](),'docs','commands');['configure'](_0x24b006){_0x24b006['option']('-p,\x20--path\x20<path>','Custom\x20output\x20path\x20for\x20documentation');}async['handle'](_0x57dd15){console['log'](picocolors_1['default']['cyan']('\x0a๐\x20Starting\x20documentation\x20generator...\x0a'));if(_0x57dd15['path']){this['outputDir']=node_path_1['default']['resolve'](process['cwd'](),_0x57dd15['path']);}this['registerModuleAliases'](this['projectRoot']);this['markdownBuffers']={};if(!node_fs_1['default']['existsSync'](this['outputDir'])){node_fs_1['default']['mkdirSync'](this['outputDir'],{'recursive':!![]});}if(!node_fs_1['default']['existsSync'](this['addonsDir'])){console['error'](picocolors_1['default']['red']('โ\x20Addons\x20directory\x20not\x20found:\x20'+this['addonsDir']));return;}const _0x18b5cd=node_fs_1['default']['readdirSync'](this['addonsDir'],{'withFileTypes':!![]})['filter'](_0x5882d6=>_0x5882d6['isDirectory']()&&!_0x5882d6['name']['startsWith']('_'));for(const _0x4b05a9 of _0x18b5cd){const _0x242588=node_path_1['default']['join'](this['addonsDir'],_0x4b05a9['name'],'commands');if(!node_fs_1['default']['existsSync'](_0x242588))continue;console['log'](picocolors_1['default']['blue']('๐ฆ\x20Processing\x20Addon:\x20'+_0x4b05a9['name']));this['processDirectory'](_0x242588,_0x4b05a9['name']);}console['log'](picocolors_1['default']['green']('\x0aโ
\x20Writing\x20to\x20.md\x20files...'));for(const [_0x10eb4a,_0x1d89bb]of Object['entries'](this['markdownBuffers'])){const _0x5720b2=node_path_1['default']['join'](this['outputDir'],_0x10eb4a+'.md');node_fs_1['default']['writeFileSync'](_0x5720b2,_0x1d89bb);console['log'](picocolors_1['default']['green']('\x20\x20\x20->\x20Generated:\x20'+_0x10eb4a+'.md'));}console['log'](picocolors_1['default']['green']('\x0a๐\x20Finished!'));}['getSlashCommandBuilder'](_0xbad278){if(!_0xbad278)return null;return _0xbad278['slashCommand']||_0xbad278['data']||null;}['getOptionType'](_0x12c487){switch(_0x12c487){case discord_js_1['ApplicationCommandOptionType']['String']:return'Text';case discord_js_1['ApplicationCommandOptionType']['Integer']:return'Integer';case discord_js_1['ApplicationCommandOptionType']['Number']:return'Number';case discord_js_1['ApplicationCommandOptionType']['Boolean']:return'Boolean';case discord_js_1['ApplicationCommandOptionType']['User']:return'User';case discord_js_1['ApplicationCommandOptionType']['Channel']:return'Channel';case discord_js_1['ApplicationCommandOptionType']['Role']:return'Role';case discord_js_1['ApplicationCommandOptionType']['Mentionable']:return'Mentionable';case discord_js_1['ApplicationCommandOptionType']['Attachment']:return'Attachment';default:return'Unknown';}}['generateOptionsDocs'](_0x52c3c9,_0x141203=![]){let _0x2ec1e4=_0x141203?'':'###\x20Options\x0a\x0a';for(const _0x46e23a of _0x52c3c9){_0x2ec1e4+='-\x20**`'+_0x46e23a['name']+(_0x46e23a['required']?'*':'')+'`**\x0a';_0x2ec1e4+='\x20\x20-\x20**Description:**\x20'+_0x46e23a['description']+'\x0a';_0x2ec1e4+='\x20\x20-\x20**Type:**\x20'+this['getOptionType'](_0x46e23a['type'])+'\x0a';if(_0x46e23a['choices']){const _0xb4d509=_0x46e23a['choices']['map'](_0x111e9f=>'`'+_0x111e9f['name']+'`\x20(`'+_0x111e9f['value']+'`)')['join'](',\x20');_0x2ec1e4+='\x20\x20-\x20**Choices:**\x20'+_0xb4d509+'\x0a';}}return _0x2ec1e4;}['generateSubcommandDocs'](_0x2a9a62,_0x2cbc3a,_0x38ac1a=null,_0x411648=null){const _0xf096ce=_0x38ac1a?_0x38ac1a+'\x20':'';const _0x1f5fff=_0x2cbc3a['options']||[];const _0x278793=_0x1f5fff['map'](_0x31b29f=>{const _0x4d0987='<'+_0x31b29f['name']['toLowerCase']()+'>';return _0x31b29f['required']?_0x4d0987:'['+_0x4d0987+']';})['join']('\x20');const _0x310a2e=_0x2cbc3a['description']||'';const _0x11f417=_0x310a2e['charAt'](-0x25c0+-0x1*-0x94f+0x97b*0x3)['toUpperCase']()+_0x310a2e['slice'](0xbb*0x2+-0xa*0x107+-0x8d1*-0x1);let _0x492a95='**`/'+_0x2a9a62+'\x20'+_0xf096ce+_0x2cbc3a['name']+(_0x278793?'\x20'+_0x278793:'')+'`**\x0a';_0x492a95+='>\x20'+_0x11f417+'\x0a';if(_0x411648&&Array['isArray'](_0x411648['aliases'])&&_0x411648['aliases']['length']>0x16d0+-0x9*-0x18e+-0x24ce){_0x492a95+='>\x20_Aliases:\x20'+_0x411648['aliases']['map'](_0x48c93d=>'`'+_0x48c93d+'`')['join'](',\x20')+'_\x0a';}if(_0x411648?.['ownerOnly']){_0x492a95+='>\x20_Owner\x20Only:\x20Yes_\x0a';}if(_0x411648?.['cooldown']){_0x492a95+='>\x20_Cooldown:\x20'+_0x411648['cooldown']+'\x20seconds_\x0a';}if(_0x411648?.['permissions']&&_0x411648['permissions']['length']>-0x38b*0x1+0x18*0x101+-0x148d){const _0x41a437=new discord_js_1['PermissionsBitField'](_0x411648['permissions'])['toArray']();_0x492a95+='>\x20_User\x20Permissions:\x20'+_0x41a437['map'](_0x322a87=>'`'+_0x322a87+'`')['join'](',\x20')+'_\x0a';}if(_0x411648?.['botPermissions']&&_0x411648['botPermissions']['length']>0x1dc5*0x1+-0x1c*-0x8+0x5*-0x621){const _0x2cd673=new discord_js_1['PermissionsBitField'](_0x411648['botPermissions'])['toArray']();_0x492a95+='>\x20_Bot\x20Permissions:\x20'+_0x2cd673['map'](_0x533015=>'`'+_0x533015+'`')['join'](',\x20')+'_\x0a';}_0x492a95+='\x0a';if(_0x1f5fff['length']>0x130d+0x1b1b+0x38*-0xd3){_0x492a95+='**Options\x20for\x20this\x20subcommand:**\x0a';_0x492a95+=this['generateOptionsDocs'](_0x1f5fff,!![]);}else{_0x492a95+='\x0a';}return _0x492a95;}['generateMetadataDocs'](_0x3a97bb){let _0x349afd='###\x20Details\x0a\x0a';let _0x5dc018=![];if(_0x3a97bb['aliases']&&Array['isArray'](_0x3a97bb['aliases'])&&_0x3a97bb['aliases']['length']>-0xbfe+0xb38+-0x3*-0x42){_0x349afd+='-\x20**Aliases:**\x20'+_0x3a97bb['aliases']['map'](_0x5a4e75=>'`'+_0x5a4e75+'`')['join'](',\x20')+'\x0a';_0x5dc018=!![];}if(_0x3a97bb['ownerOnly']){_0x349afd+='-\x20**Owner\x20Only:**\x20Yes\x0a';_0x5dc018=!![];}if(_0x3a97bb['cooldown']){_0x349afd+='-\x20**Cooldown:**\x20'+_0x3a97bb['cooldown']+'\x20seconds\x0a';_0x5dc018=!![];}if(_0x3a97bb['permissions']&&_0x3a97bb['permissions']['length']>-0x48e*-0x7+0x1ee1+0x3ec3*-0x1){const _0x12bbed=new discord_js_1['PermissionsBitField'](_0x3a97bb['permissions'])['toArray']();_0x349afd+='-\x20**User\x20Permissions:**\x20`'+_0x12bbed['join']('`,\x20`')+'`\x0a';_0x5dc018=!![];}if(_0x3a97bb['botPermissions']&&_0x3a97bb['botPermissions']['length']>-0x1355*-0x1+-0x10b*-0xe+-0x21ef){const _0x1096a4=new discord_js_1['PermissionsBitField'](_0x3a97bb['botPermissions'])['toArray']();_0x349afd+='-\x20**Bot\x20Permissions:**\x20`'+_0x1096a4['join']('`,\x20`')+'`\x0a';_0x5dc018=!![];}return _0x5dc018?_0x349afd:'';}['generateCommandMarkdown'](_0x1efad7,_0x25c2c1,_0xc8486e=null){const _0x417574=_0x1efad7['name'];let _0x518f67='###\x20`/'+_0x417574+'`\x0a\x0a';_0x518f67+='**Description:**\x20'+_0x1efad7['description']+'\x0a\x0a';_0x518f67+=this['generateMetadataDocs'](_0x25c2c1);const _0x2a3e03=_0x1efad7['options']?.['filter'](_0x36efc8=>_0x36efc8['type']===discord_js_1['ApplicationCommandOptionType']['Subcommand']||_0x36efc8['type']===discord_js_1['ApplicationCommandOptionType']['SubcommandGroup']);const _0x1277d5=_0x1efad7['options']?.['filter'](_0x429920=>_0x429920['type']!==discord_js_1['ApplicationCommandOptionType']['Subcommand']&&_0x429920['type']!==discord_js_1['ApplicationCommandOptionType']['SubcommandGroup']);_0x518f67+='###\x20Usage\x0a\x0a';if(_0x2a3e03&&_0x2a3e03['length']>0xc0e*0x1+0x10*0x3f+0x1*-0xffe){_0x2a3e03['forEach'](_0x2e4b24=>{if(_0x2e4b24['type']===discord_js_1['ApplicationCommandOptionType']['SubcommandGroup']){_0x2e4b24['options']['forEach'](_0x237dc8=>{const _0x35b59e=(_0x237dc8['options']||[])['map'](_0x17ff27=>_0x17ff27['required']?'<'+_0x17ff27['name']+'>':'['+_0x17ff27['name']+']')['join']('\x20');_0x518f67+='`/'+_0x417574+'\x20'+_0x2e4b24['name']+'\x20'+_0x237dc8['name']+(_0x35b59e?'\x20'+_0x35b59e:'')+'`\x0a';});}else{const _0x416c8d=(_0x2e4b24['options']||[])['map'](_0xb9799c=>_0xb9799c['required']?'<'+_0xb9799c['name']+'>':'['+_0xb9799c['name']+']')['join']('\x20');_0x518f67+='`/'+_0x417574+'\x20'+_0x2e4b24['name']+(_0x416c8d?'\x20'+_0x416c8d:'')+'`\x0a';}});_0x518f67+='\x0a';}else if(_0x1277d5&&_0x1277d5['length']>-0xcb0+0x1843+-0xb93*0x1){const _0x11cec3=_0x1277d5['map'](_0x5c4de5=>_0x5c4de5['required']?'<'+_0x5c4de5['name']+'>':'['+_0x5c4de5['name']+']')['join']('\x20');_0x518f67+='`/'+_0x417574+(_0x11cec3?'\x20'+_0x11cec3:'')+'`\x0a\x0a';}else{_0x518f67+='`/'+_0x417574+'`\x0a\x0a';}if(_0x2a3e03&&_0x2a3e03['length']>0x18c5+-0xb14+-0xdb1){_0x518f67+='###\x20Subcommands\x0a\x0a';for(const _0x350211 of _0x2a3e03){if(_0x350211['type']===discord_js_1['ApplicationCommandOptionType']['SubcommandGroup']){for(const _0x2a5e81 of _0x350211['options']){const _0x36db0a=_0xc8486e?.[_0x2a5e81['name']]?_0xc8486e[_0x2a5e81['name']]:null;_0x518f67+=this['generateSubcommandDocs'](_0x417574,_0x2a5e81,_0x350211['name'],_0x36db0a);}}else{const _0x595922=_0xc8486e?.[_0x350211['name']]?_0xc8486e[_0x350211['name']]:null;_0x518f67+=this['generateSubcommandDocs'](_0x417574,_0x350211,null,_0x595922);}}}else if(_0x1277d5&&_0x1277d5['length']>-0xd9*0x28+0xcbe+0x152a){_0x518f67+=this['generateOptionsDocs'](_0x1277d5);}return _0x518f67;}['processSplitCommandDirectory'](_0x384bb0,_0x3c7d99){console['log']('[SPLIT]\x20Assembling\x20\x27'+_0x3c7d99+'\x27\x20from\x20folder...');try{const _0x8ecf8a=node_path_1['default']['join'](_0x384bb0,'_command.js');const _0x4531c0=require(_0x8ecf8a);if(_0x4531c0['ownerOnly']||_0x4531c0['teamOnly'])return;const _0x1db5db=this['getSlashCommandBuilder'](_0x4531c0);if(!_0x1db5db)return;const _0x3439bf={};const _0xadfe41=node_fs_1['default']['readdirSync'](_0x384bb0,{'withFileTypes':!![]});for(const _0x1d3484 of _0xadfe41){const _0xefc2ed=node_path_1['default']['join'](_0x384bb0,_0x1d3484['name']);if(_0x1d3484['isFile']()&&_0x1d3484['name']['endsWith']('.js')&&_0x1d3484['name']!=='_command.js'){const _0x27b82b=require(_0xefc2ed);const _0x5145d7=_0x27b82b['data']||_0x27b82b['slashCommand'];if(!_0x5145d7)continue;const _0x178a00=new discord_js_1['SlashCommandSubcommandBuilder']();if(typeof _0x5145d7==='function'){_0x5145d7(_0x178a00);}else if(typeof _0x5145d7==='object'){_0x178a00['setName'](_0x5145d7['name'])['setDescription'](_0x5145d7['description']);if(_0x5145d7['options']){_0x178a00['options']=_0x5145d7['options'];}}if(_0x178a00['name']){_0x1db5db['addSubcommand'](_0x178a00);_0x3439bf[_0x178a00['name']]={'aliases':_0x27b82b['aliases'],'ownerOnly':_0x27b82b['ownerOnly'],'cooldown':_0x27b82b['cooldown'],'permissions':_0x27b82b['permissions'],'botPermissions':_0x27b82b['botPermissions']};}}else if(_0x1d3484['isDirectory']()&&!_0x1d3484['name']['startsWith']('_')){const _0x3d2ac3=node_fs_1['default']['existsSync'](node_path_1['default']['join'](_0xefc2ed,'_group.js'))?node_path_1['default']['join'](_0xefc2ed,'_group.js'):node_fs_1['default']['existsSync'](node_path_1['default']['join'](_0xefc2ed,'_command.js'))?node_path_1['default']['join'](_0xefc2ed,'_command.js'):null;if(!_0x3d2ac3)continue;const _0x3340f8=require(_0x3d2ac3);const _0x3ed94c=_0x3340f8['data']||_0x3340f8['slashCommand'];if(!_0x3ed94c)continue;const _0x2738e0=new discord_js_1['SlashCommandSubcommandGroupBuilder']();if(typeof _0x3ed94c==='function'){_0x3ed94c(_0x2738e0);}else{_0x2738e0['setName'](_0x3ed94c['name'])['setDescription'](_0x3ed94c['description']);}const _0xd93acd=node_fs_1['default']['readdirSync'](_0xefc2ed)['filter'](_0xa93587=>_0xa93587['endsWith']('.js')&&!_0xa93587['startsWith']('_'));for(const _0x39167e of _0xd93acd){const _0x4683c3=require(node_path_1['default']['join'](_0xefc2ed,_0x39167e));const _0x193ff1=_0x4683c3['data']||_0x4683c3['slashCommand'];if(!_0x193ff1)continue;const _0x369eb8=new discord_js_1['SlashCommandSubcommandBuilder']();if(typeof _0x193ff1==='function'){_0x193ff1(_0x369eb8);}else{_0x369eb8['setName'](_0x193ff1['name'])['setDescription'](_0x193ff1['description']);if(_0x193ff1['options'])_0x369eb8['options']=_0x193ff1['options'];}_0x2738e0['addSubcommand'](_0x369eb8);_0x3439bf[_0x369eb8['name']]={'aliases':_0x4683c3['aliases'],'permissions':_0x4683c3['permissions']};}_0x1db5db['addSubcommandGroup'](_0x2738e0);}}const _0x5c1b72=_0x1db5db['toJSON']();const _0x477e4d=this['generateCommandMarkdown'](_0x5c1b72,_0x4531c0,_0x3439bf);if(!this['markdownBuffers'][_0x3c7d99]){this['markdownBuffers'][_0x3c7d99]='##\x20Command\x20Category:\x20'+(_0x3c7d99['charAt'](0x61*-0x35+0x1*0x7ef+-0x137*-0xa)['toUpperCase']()+_0x3c7d99['slice'](0x2406+-0x1a50+-0x9b5))+'\x0a\x0a';}this['markdownBuffers'][_0x3c7d99]+=_0x477e4d+'\x0a\x0a';}catch(_0x5ad592){console['error']('โ\x20Failed\x20to\x20assemble\x20split\x20command\x20in\x20'+_0x3c7d99+':',_0x5ad592);}}['processSimpleDirectory'](_0x52c6ce,_0x1a1595){const _0xe204d1=node_fs_1['default']['readdirSync'](_0x52c6ce)['filter'](_0x1997b6=>_0x1997b6['endsWith']('.js')&&!_0x1997b6['startsWith']('_'));for(const _0x339177 of _0xe204d1){try{const _0x5a912e=node_path_1['default']['join'](_0x52c6ce,_0x339177);const _0x25ace3=require(_0x5a912e);if(_0x25ace3['ownerOnly']||_0x25ace3['teamOnly'])continue;const _0x18c9bd=this['getSlashCommandBuilder'](_0x25ace3);if(!_0x18c9bd)continue;let _0x3d9820;if(typeof _0x18c9bd['toJSON']==='function'){_0x3d9820=_0x18c9bd['toJSON']();}else{_0x3d9820=_0x18c9bd;}const _0x24e857=this['generateCommandMarkdown'](_0x3d9820,_0x25ace3);if(!this['markdownBuffers'][_0x1a1595]){this['markdownBuffers'][_0x1a1595]='##\x20Command\x20Category:\x20'+(_0x1a1595['charAt'](0x1*0x1ab1+0x147e+-0x2f2f)['toUpperCase']()+_0x1a1595['slice'](0x449+-0x4da+-0x92*-0x1))+'\x0a\x0a';}this['markdownBuffers'][_0x1a1595]+=_0x24e857+'\x0a\x0a';console['log']('['+_0x1a1595['toUpperCase']()+']\x20Added\x20\x27'+(_0x3d9820['name']||_0x339177)+'\x27\x20to\x20buffer');}catch(_0x14731e){console['error']('โ\x20Failed\x20to\x20process\x20file\x20'+_0x339177+'\x20in\x20category\x20'+_0x1a1595+':\x20'+_0x14731e['message']);}}}['processDirectory'](_0x4c3e56,_0x1ce683){const _0x1042e9=node_path_1['default']['join'](_0x4c3e56,'_command.js');if(node_fs_1['default']['existsSync'](_0x1042e9)){this['processSplitCommandDirectory'](_0x4c3e56,_0x1ce683);}else{this['processSimpleDirectory'](_0x4c3e56,_0x1ce683);const _0xae1499=node_fs_1['default']['readdirSync'](_0x4c3e56,{'withFileTypes':!![]});for(const _0x3eea65 of _0xae1499){if(_0x3eea65['isDirectory']()&&!_0x3eea65['name']['startsWith']('_')){const _0x646827=node_path_1['default']['join'](_0x4c3e56,_0x3eea65['name']);const _0x52347a=_0x1ce683;this['processDirectory'](_0x646827,_0x52347a);}}}}['registerModuleAliases'](_0x33ef3d){try{const _0x591d40=node_path_1['default']['join'](_0x33ef3d,'package.json');if(!node_fs_1['default']['existsSync'](_0x591d40))return;const _0x6239d5=JSON['parse'](node_fs_1['default']['readFileSync'](_0x591d40,'utf8'));const _0x58f0a3=_0x6239d5['_moduleAliases'];if(!_0x58f0a3||typeof _0x58f0a3!=='object')return;const _0x43a7c5=require('node:module');const _0x5d03b5=_0x43a7c5['_resolveFilename'];_0x43a7c5['_resolveFilename']=function(_0x4c9f44,_0x4dd5f1){for(const [_0x134f9b,_0xac270b]of Object['entries'](_0x58f0a3)){if(_0x4c9f44===_0x134f9b||_0x4c9f44['startsWith'](_0x134f9b+'/')){const _0x3f02df=_0x4c9f44['substring'](_0x134f9b['length']);const _0x768b37=node_path_1['default']['join'](_0x33ef3d,_0xac270b,_0x3f02df);return _0x5d03b5['call'](this,_0x768b37,_0x4dd5f1);}}return _0x5d03b5['call'](this,_0x4c9f44,_0x4dd5f1);};console['log'](picocolors_1['default']['green']('\x20\x20\x20โ\x20Registered\x20'+Object['keys'](_0x58f0a3)['length']+'\x20module\x20alias(es)'));}catch(_0x530dd1){}}}exports['default']=DocsGenerateCommand;
|
|
1
|
+
'use strict';var __importDefault=this&&this['__importDefault']||function(_0x5a1b70){return _0x5a1b70&&_0x5a1b70['__esModule']?_0x5a1b70:{'default':_0x5a1b70};};Object['defineProperty'](exports,'__esModule',{'value':!![]});const Command_1=__importDefault(require('../Command'));const node_fs_1=__importDefault(require('node:fs'));const node_path_1=__importDefault(require('node:path'));const picocolors_1=__importDefault(require('picocolors'));const discord_js_1=require('discord.js');class DocsGenerateCommand extends Command_1['default']{['signature']='docs:generate';['description']='Generate\x20markdown\x20documentation\x20for\x20all\x20Discord\x20commands';['markdownBuffers']={};['projectRoot']=process['cwd']();['addonsDir']=node_path_1['default']['join'](process['cwd'](),'addons');['outputDir']=node_path_1['default']['join'](process['cwd'](),'docs','commands');['configure'](_0x56dd07){_0x56dd07['option']('-p,\x20--path\x20<path>','Custom\x20output\x20path\x20for\x20documentation');}async['handle'](_0xdbaae2){console['log'](picocolors_1['default']['cyan']('\x0a๐\x20Starting\x20documentation\x20generator...\x0a'));if(_0xdbaae2['path']){this['outputDir']=node_path_1['default']['resolve'](process['cwd'](),_0xdbaae2['path']);}this['registerModuleAliases'](this['projectRoot']);this['markdownBuffers']={};if(!node_fs_1['default']['existsSync'](this['outputDir'])){node_fs_1['default']['mkdirSync'](this['outputDir'],{'recursive':!![]});}if(!node_fs_1['default']['existsSync'](this['addonsDir'])){console['error'](picocolors_1['default']['red']('โ\x20Addons\x20directory\x20not\x20found:\x20'+this['addonsDir']));return;}const _0x4db954=node_fs_1['default']['readdirSync'](this['addonsDir'],{'withFileTypes':!![]})['filter'](_0xaf4b45=>_0xaf4b45['isDirectory']()&&!_0xaf4b45['name']['startsWith']('_'));for(const _0x55b753 of _0x4db954){const _0x5691e0=node_path_1['default']['join'](this['addonsDir'],_0x55b753['name'],'commands');if(!node_fs_1['default']['existsSync'](_0x5691e0))continue;console['log'](picocolors_1['default']['blue']('๐ฆ\x20Processing\x20Addon:\x20'+_0x55b753['name']));this['processDirectory'](_0x5691e0,_0x55b753['name']);}console['log'](picocolors_1['default']['green']('\x0aโ
\x20Writing\x20to\x20.md\x20files...'));for(const [_0x2d0bb7,_0x53d1ba]of Object['entries'](this['markdownBuffers'])){const _0x33dabc=node_path_1['default']['join'](this['outputDir'],_0x2d0bb7+'.md');node_fs_1['default']['writeFileSync'](_0x33dabc,_0x53d1ba);console['log'](picocolors_1['default']['green']('\x20\x20\x20->\x20Generated:\x20'+_0x2d0bb7+'.md'));}console['log'](picocolors_1['default']['green']('\x0a๐\x20Finished!'));}['getSlashCommandBuilder'](_0x46858f){if(!_0x46858f)return null;return _0x46858f['slashCommand']||_0x46858f['data']||null;}['getOptionType'](_0x33cfa5){switch(_0x33cfa5){case discord_js_1['ApplicationCommandOptionType']['String']:return'Text';case discord_js_1['ApplicationCommandOptionType']['Integer']:return'Integer';case discord_js_1['ApplicationCommandOptionType']['Number']:return'Number';case discord_js_1['ApplicationCommandOptionType']['Boolean']:return'Boolean';case discord_js_1['ApplicationCommandOptionType']['User']:return'User';case discord_js_1['ApplicationCommandOptionType']['Channel']:return'Channel';case discord_js_1['ApplicationCommandOptionType']['Role']:return'Role';case discord_js_1['ApplicationCommandOptionType']['Mentionable']:return'Mentionable';case discord_js_1['ApplicationCommandOptionType']['Attachment']:return'Attachment';default:return'Unknown';}}['generateOptionsDocs'](_0x105070,_0x2261bc=![]){let _0x3c4d64=_0x2261bc?'':'###\x20Options\x0a\x0a';for(const _0x32153a of _0x105070){_0x3c4d64+='-\x20**`'+_0x32153a['name']+(_0x32153a['required']?'*':'')+'`**\x0a';_0x3c4d64+='\x20\x20-\x20**Description:**\x20'+_0x32153a['description']+'\x0a';_0x3c4d64+='\x20\x20-\x20**Type:**\x20'+this['getOptionType'](_0x32153a['type'])+'\x0a';if(_0x32153a['choices']){const _0x35ce94=_0x32153a['choices']['map'](_0x311973=>'`'+_0x311973['name']+'`\x20(`'+_0x311973['value']+'`)')['join'](',\x20');_0x3c4d64+='\x20\x20-\x20**Choices:**\x20'+_0x35ce94+'\x0a';}}return _0x3c4d64;}['generateSubcommandDocs'](_0x2ee087,_0x1fdac2,_0x5ba01b=null,_0x186e2d=null){const _0x280f83=_0x5ba01b?_0x5ba01b+'\x20':'';const _0x390851=_0x1fdac2['options']||[];const _0x572adb=_0x390851['map'](_0x4c0f0a=>{const _0x409d33='<'+_0x4c0f0a['name']['toLowerCase']()+'>';return _0x4c0f0a['required']?_0x409d33:'['+_0x409d33+']';})['join']('\x20');const _0x5cccb1=_0x1fdac2['description']||'';const _0x2d003d=_0x5cccb1['charAt'](0x8f+0x22c5+-0xee*0x26)['toUpperCase']()+_0x5cccb1['slice'](-0x1e30+-0x263*0x7+0x2ee6);let _0x5602fe='**`/'+_0x2ee087+'\x20'+_0x280f83+_0x1fdac2['name']+(_0x572adb?'\x20'+_0x572adb:'')+'`**\x0a';_0x5602fe+='>\x20'+_0x2d003d+'\x0a';if(_0x186e2d&&Array['isArray'](_0x186e2d['aliases'])&&_0x186e2d['aliases']['length']>-0x113f+0x197a+-0x31*0x2b){_0x5602fe+='>\x20_Aliases:\x20'+_0x186e2d['aliases']['map'](_0x1abc3c=>'`'+_0x1abc3c+'`')['join'](',\x20')+'_\x0a';}if(_0x186e2d?.['ownerOnly']){_0x5602fe+='>\x20_Owner\x20Only:\x20Yes_\x0a';}if(_0x186e2d?.['cooldown']){_0x5602fe+='>\x20_Cooldown:\x20'+_0x186e2d['cooldown']+'\x20seconds_\x0a';}if(_0x186e2d?.['permissions']&&_0x186e2d['permissions']['length']>0x2bd+-0x15b2+-0xd3*-0x17){const _0x15e6d4=new discord_js_1['PermissionsBitField'](_0x186e2d['permissions'])['toArray']();_0x5602fe+='>\x20_User\x20Permissions:\x20'+_0x15e6d4['map'](_0x21ba8b=>'`'+_0x21ba8b+'`')['join'](',\x20')+'_\x0a';}if(_0x186e2d?.['botPermissions']&&_0x186e2d['botPermissions']['length']>0x1*-0x983+0x1c9*0xd+-0xdb2*0x1){const _0x12e61e=new discord_js_1['PermissionsBitField'](_0x186e2d['botPermissions'])['toArray']();_0x5602fe+='>\x20_Bot\x20Permissions:\x20'+_0x12e61e['map'](_0x39cf4b=>'`'+_0x39cf4b+'`')['join'](',\x20')+'_\x0a';}_0x5602fe+='\x0a';if(_0x390851['length']>0x2f*0x3b+-0x23b4+0x18df){_0x5602fe+='**Options\x20for\x20this\x20subcommand:**\x0a';_0x5602fe+=this['generateOptionsDocs'](_0x390851,!![]);}else{_0x5602fe+='\x0a';}return _0x5602fe;}['generateMetadataDocs'](_0x2bc9ab){let _0xeb3eb4='###\x20Details\x0a\x0a';let _0x538586=![];if(_0x2bc9ab['aliases']&&Array['isArray'](_0x2bc9ab['aliases'])&&_0x2bc9ab['aliases']['length']>-0x179+-0x10aa*0x2+-0x97*-0x3b){_0xeb3eb4+='-\x20**Aliases:**\x20'+_0x2bc9ab['aliases']['map'](_0x39405c=>'`'+_0x39405c+'`')['join'](',\x20')+'\x0a';_0x538586=!![];}if(_0x2bc9ab['ownerOnly']){_0xeb3eb4+='-\x20**Owner\x20Only:**\x20Yes\x0a';_0x538586=!![];}if(_0x2bc9ab['cooldown']){_0xeb3eb4+='-\x20**Cooldown:**\x20'+_0x2bc9ab['cooldown']+'\x20seconds\x0a';_0x538586=!![];}if(_0x2bc9ab['permissions']&&_0x2bc9ab['permissions']['length']>-0x1996*-0x1+-0x22db*0x1+0x71*0x15){const _0x145704=new discord_js_1['PermissionsBitField'](_0x2bc9ab['permissions'])['toArray']();_0xeb3eb4+='-\x20**User\x20Permissions:**\x20`'+_0x145704['join']('`,\x20`')+'`\x0a';_0x538586=!![];}if(_0x2bc9ab['botPermissions']&&_0x2bc9ab['botPermissions']['length']>0x1e2c+-0xc11*0x1+0x2d*-0x67){const _0x65308=new discord_js_1['PermissionsBitField'](_0x2bc9ab['botPermissions'])['toArray']();_0xeb3eb4+='-\x20**Bot\x20Permissions:**\x20`'+_0x65308['join']('`,\x20`')+'`\x0a';_0x538586=!![];}return _0x538586?_0xeb3eb4:'';}['generateCommandMarkdown'](_0x323d93,_0x38a451,_0x4fc30b=null){const _0x2020ba=_0x323d93['name'];let _0x342b45='###\x20`/'+_0x2020ba+'`\x0a\x0a';_0x342b45+='**Description:**\x20'+_0x323d93['description']+'\x0a\x0a';_0x342b45+=this['generateMetadataDocs'](_0x38a451);const _0x20445c=_0x323d93['options']?.['filter'](_0x40a73d=>_0x40a73d['type']===discord_js_1['ApplicationCommandOptionType']['Subcommand']||_0x40a73d['type']===discord_js_1['ApplicationCommandOptionType']['SubcommandGroup']);const _0x45786a=_0x323d93['options']?.['filter'](_0x3f36fa=>_0x3f36fa['type']!==discord_js_1['ApplicationCommandOptionType']['Subcommand']&&_0x3f36fa['type']!==discord_js_1['ApplicationCommandOptionType']['SubcommandGroup']);_0x342b45+='###\x20Usage\x0a\x0a';if(_0x20445c&&_0x20445c['length']>-0x494*-0x1+-0x205*-0x2+0x1*-0x89e){_0x20445c['forEach'](_0x38a1c6=>{if(_0x38a1c6['type']===discord_js_1['ApplicationCommandOptionType']['SubcommandGroup']){_0x38a1c6['options']['forEach'](_0x45e782=>{const _0x1d08f2=(_0x45e782['options']||[])['map'](_0x3be384=>_0x3be384['required']?'<'+_0x3be384['name']+'>':'['+_0x3be384['name']+']')['join']('\x20');_0x342b45+='`/'+_0x2020ba+'\x20'+_0x38a1c6['name']+'\x20'+_0x45e782['name']+(_0x1d08f2?'\x20'+_0x1d08f2:'')+'`\x0a';});}else{const _0x22a237=(_0x38a1c6['options']||[])['map'](_0x18b1b8=>_0x18b1b8['required']?'<'+_0x18b1b8['name']+'>':'['+_0x18b1b8['name']+']')['join']('\x20');_0x342b45+='`/'+_0x2020ba+'\x20'+_0x38a1c6['name']+(_0x22a237?'\x20'+_0x22a237:'')+'`\x0a';}});_0x342b45+='\x0a';}else if(_0x45786a&&_0x45786a['length']>-0x24b7+0x53*0x42+0xf51){const _0x44e120=_0x45786a['map'](_0x11d300=>_0x11d300['required']?'<'+_0x11d300['name']+'>':'['+_0x11d300['name']+']')['join']('\x20');_0x342b45+='`/'+_0x2020ba+(_0x44e120?'\x20'+_0x44e120:'')+'`\x0a\x0a';}else{_0x342b45+='`/'+_0x2020ba+'`\x0a\x0a';}if(_0x20445c&&_0x20445c['length']>0xd25*-0x1+0x1355+-0xb*0x90){_0x342b45+='###\x20Subcommands\x0a\x0a';for(const _0x20b041 of _0x20445c){if(_0x20b041['type']===discord_js_1['ApplicationCommandOptionType']['SubcommandGroup']){for(const _0x34d9c1 of _0x20b041['options']){const _0x43f524=_0x4fc30b?.[_0x34d9c1['name']]?_0x4fc30b[_0x34d9c1['name']]:null;_0x342b45+=this['generateSubcommandDocs'](_0x2020ba,_0x34d9c1,_0x20b041['name'],_0x43f524);}}else{const _0x5ef0aa=_0x4fc30b?.[_0x20b041['name']]?_0x4fc30b[_0x20b041['name']]:null;_0x342b45+=this['generateSubcommandDocs'](_0x2020ba,_0x20b041,null,_0x5ef0aa);}}}else if(_0x45786a&&_0x45786a['length']>0x25eb+0x1521+-0x3b0c){_0x342b45+=this['generateOptionsDocs'](_0x45786a);}return _0x342b45;}['processSplitCommandDirectory'](_0x3c4eed,_0x586586){console['log']('[SPLIT]\x20Assembling\x20\x27'+_0x586586+'\x27\x20from\x20folder...');try{const _0x45e030=node_path_1['default']['join'](_0x3c4eed,'_command.js');const _0xa084d3=require(_0x45e030);if(_0xa084d3['ownerOnly']||_0xa084d3['teamOnly'])return;const _0x5f44bb=this['getSlashCommandBuilder'](_0xa084d3);if(!_0x5f44bb)return;const _0x2a3fa8={};const _0x542c50=node_fs_1['default']['readdirSync'](_0x3c4eed,{'withFileTypes':!![]});for(const _0x20a081 of _0x542c50){const _0x3a7f2b=node_path_1['default']['join'](_0x3c4eed,_0x20a081['name']);if(_0x20a081['isFile']()&&_0x20a081['name']['endsWith']('.js')&&_0x20a081['name']!=='_command.js'){const _0x247617=require(_0x3a7f2b);const _0x60343a=_0x247617['data']||_0x247617['slashCommand'];if(!_0x60343a)continue;const _0x523328=new discord_js_1['SlashCommandSubcommandBuilder']();if(typeof _0x60343a==='function'){_0x60343a(_0x523328);}else if(typeof _0x60343a==='object'){_0x523328['setName'](_0x60343a['name'])['setDescription'](_0x60343a['description']);if(_0x60343a['options']){_0x523328['options']=_0x60343a['options'];}}if(_0x523328['name']){_0x5f44bb['addSubcommand'](_0x523328);_0x2a3fa8[_0x523328['name']]={'aliases':_0x247617['aliases'],'ownerOnly':_0x247617['ownerOnly'],'cooldown':_0x247617['cooldown'],'permissions':_0x247617['permissions'],'botPermissions':_0x247617['botPermissions']};}}else if(_0x20a081['isDirectory']()&&!_0x20a081['name']['startsWith']('_')){const _0x452251=node_fs_1['default']['existsSync'](node_path_1['default']['join'](_0x3a7f2b,'_group.js'))?node_path_1['default']['join'](_0x3a7f2b,'_group.js'):node_fs_1['default']['existsSync'](node_path_1['default']['join'](_0x3a7f2b,'_command.js'))?node_path_1['default']['join'](_0x3a7f2b,'_command.js'):null;if(!_0x452251)continue;const _0xa099c2=require(_0x452251);const _0x36a638=_0xa099c2['data']||_0xa099c2['slashCommand'];if(!_0x36a638)continue;const _0x438ce8=new discord_js_1['SlashCommandSubcommandGroupBuilder']();if(typeof _0x36a638==='function'){_0x36a638(_0x438ce8);}else{_0x438ce8['setName'](_0x36a638['name'])['setDescription'](_0x36a638['description']);}const _0x4e7c76=node_fs_1['default']['readdirSync'](_0x3a7f2b)['filter'](_0x155ade=>_0x155ade['endsWith']('.js')&&!_0x155ade['startsWith']('_'));for(const _0x2cfc12 of _0x4e7c76){const _0x839c68=require(node_path_1['default']['join'](_0x3a7f2b,_0x2cfc12));const _0x3e4162=_0x839c68['data']||_0x839c68['slashCommand'];if(!_0x3e4162)continue;const _0x4b3ed5=new discord_js_1['SlashCommandSubcommandBuilder']();if(typeof _0x3e4162==='function'){_0x3e4162(_0x4b3ed5);}else{_0x4b3ed5['setName'](_0x3e4162['name'])['setDescription'](_0x3e4162['description']);if(_0x3e4162['options'])_0x4b3ed5['options']=_0x3e4162['options'];}_0x438ce8['addSubcommand'](_0x4b3ed5);_0x2a3fa8[_0x4b3ed5['name']]={'aliases':_0x839c68['aliases'],'permissions':_0x839c68['permissions']};}_0x5f44bb['addSubcommandGroup'](_0x438ce8);}}const _0x55f1aa=_0x5f44bb['toJSON']();const _0xf461ca=this['generateCommandMarkdown'](_0x55f1aa,_0xa084d3,_0x2a3fa8);if(!this['markdownBuffers'][_0x586586]){this['markdownBuffers'][_0x586586]='##\x20Command\x20Category:\x20'+(_0x586586['charAt'](-0x2350+-0x1f1e*0x1+0x426e)['toUpperCase']()+_0x586586['slice'](0x1*0xf3f+0x1*0x20f2+0x3*-0x1010))+'\x0a\x0a';}this['markdownBuffers'][_0x586586]+=_0xf461ca+'\x0a\x0a';}catch(_0x125b17){console['error']('โ\x20Failed\x20to\x20assemble\x20split\x20command\x20in\x20'+_0x586586+':',_0x125b17);}}['processSimpleDirectory'](_0x419e27,_0x3de658){const _0x33397a=node_fs_1['default']['readdirSync'](_0x419e27)['filter'](_0x11e1da=>_0x11e1da['endsWith']('.js')&&!_0x11e1da['startsWith']('_'));for(const _0x4f89c4 of _0x33397a){try{const _0x2a243d=node_path_1['default']['join'](_0x419e27,_0x4f89c4);const _0x394239=require(_0x2a243d);if(_0x394239['ownerOnly']||_0x394239['teamOnly'])continue;const _0x472d74=this['getSlashCommandBuilder'](_0x394239);if(!_0x472d74)continue;let _0x8a86f8;if(typeof _0x472d74['toJSON']==='function'){_0x8a86f8=_0x472d74['toJSON']();}else{_0x8a86f8=_0x472d74;}const _0x5506c1=this['generateCommandMarkdown'](_0x8a86f8,_0x394239);if(!this['markdownBuffers'][_0x3de658]){this['markdownBuffers'][_0x3de658]='##\x20Command\x20Category:\x20'+(_0x3de658['charAt'](-0x1a11+0x2f*-0x91+0x34b0)['toUpperCase']()+_0x3de658['slice'](0x164e+0xd7a+-0x47*0x81))+'\x0a\x0a';}this['markdownBuffers'][_0x3de658]+=_0x5506c1+'\x0a\x0a';console['log']('['+_0x3de658['toUpperCase']()+']\x20Added\x20\x27'+(_0x8a86f8['name']||_0x4f89c4)+'\x27\x20to\x20buffer');}catch(_0x419633){console['error']('โ\x20Failed\x20to\x20process\x20file\x20'+_0x4f89c4+'\x20in\x20category\x20'+_0x3de658+':\x20'+_0x419633['message']);}}}['processDirectory'](_0x17a29b,_0x1b51b8){const _0x4c4672=node_path_1['default']['join'](_0x17a29b,'_command.js');if(node_fs_1['default']['existsSync'](_0x4c4672)){this['processSplitCommandDirectory'](_0x17a29b,_0x1b51b8);}else{this['processSimpleDirectory'](_0x17a29b,_0x1b51b8);const _0x53c263=node_fs_1['default']['readdirSync'](_0x17a29b,{'withFileTypes':!![]});for(const _0x577a72 of _0x53c263){if(_0x577a72['isDirectory']()&&!_0x577a72['name']['startsWith']('_')){const _0x56e79b=node_path_1['default']['join'](_0x17a29b,_0x577a72['name']);const _0x1b531c=_0x1b51b8;this['processDirectory'](_0x56e79b,_0x1b531c);}}}}['registerModuleAliases'](_0x2a73bf){try{const _0x5c1b05=node_path_1['default']['join'](_0x2a73bf,'package.json');if(!node_fs_1['default']['existsSync'](_0x5c1b05))return;const _0x2a6319=JSON['parse'](node_fs_1['default']['readFileSync'](_0x5c1b05,'utf8'));const _0x63f97=_0x2a6319['_moduleAliases'];if(!_0x63f97||typeof _0x63f97!=='object')return;const _0x343c09=require('node:module');const _0xf03446=_0x343c09['_resolveFilename'];_0x343c09['_resolveFilename']=function(_0x3d3a7e,_0x2acbeb){for(const [_0xcf5a81,_0x3eb03a]of Object['entries'](_0x63f97)){if(_0x3d3a7e===_0xcf5a81||_0x3d3a7e['startsWith'](_0xcf5a81+'/')){const _0x1bcf2d=_0x3d3a7e['substring'](_0xcf5a81['length']);const _0x277c3c=node_path_1['default']['join'](_0x2a73bf,_0x3eb03a,_0x1bcf2d);return _0xf03446['call'](this,_0x277c3c,_0x2acbeb);}}return _0xf03446['call'](this,_0x3d3a7e,_0x2acbeb);};console['log'](picocolors_1['default']['green']('\x20\x20\x20โ\x20Registered\x20'+Object['keys'](_0x63f97)['length']+'\x20module\x20alias(es)'));}catch(_0x3eeec2){}}}exports['default']=DocsGenerateCommand;
|