UNPKG

ihrz

Version:
88 lines (78 loc) 3.46 kB
/* ・ iHorizon Discord Bot (https://gitlab.com/ihrz/ihrz) ・ Licensed under the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) ・ Under the following terms: ・ Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. ・ NonCommercial — You may not use the material for commercial purposes. ・ ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. ・ No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. ・ Mainly developed by Kisakay (https://gitlab.com/Kisakay) ・ Copyright © 2020-2025 iHorizon */ import { Client, Partials, GatewayIntentBits } from 'discord.js'; class iHorizonBuilder { config; client; import; constructor(config) { if (!config) { throw new Error(`Config is a required option. (val=${config})`); } this.import = { colors: null, core: null, version: null }; this.config = config; this.client = new Client({ intents: [ GatewayIntentBits.AutoModerationConfiguration, GatewayIntentBits.AutoModerationExecution, GatewayIntentBits.DirectMessageReactions, GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessageTyping, GatewayIntentBits.GuildEmojisAndStickers, GatewayIntentBits.GuildIntegrations, GatewayIntentBits.GuildInvites, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageTyping, GatewayIntentBits.GuildModeration, GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildScheduledEvents, GatewayIntentBits.Guilds, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildWebhooks, GatewayIntentBits.MessageContent ], partials: [ Partials.Channel, Partials.Message, Partials.GuildMember, Partials.GuildScheduledEvent, Partials.User, Partials.Reaction, Partials.ThreadMember ] }); this.client.config = this.config; global.config = this.config; this.client.isModuled = true; } async importModules() { // import manually colors.js this.import.colors = await import('./src/core/functions/colors.js'); // import manually core.js this.import.core = await import('./src/core/core.js'); // import manually version.js this.import.version = await import('./src/version.js'); } async start() { await this.importModules(); this.client.version = this.import.version; this.client.inShard = function (guildId) { return true; }; this.import.core.main(this.client); } } export { iHorizonBuilder };