import { Client, Guild, Message, Role, TextChannel } from 'discord.js'; import { DyNTS_SingletonService } from '../../../_services/base/singleton.service'; import { DyNTS_DiBo_Routines_ControlService } from './dibo-routines.control-service'; import { DyNTS_DiBo_IO_ControlService } from './dibo-io.control-service'; import { DyNTS_DiBo_Commands_ControlService } from './dibo-commands.control-service'; /** * This is the main control service for the Discord Bot. * * * Setup: * 1. creating the Bot * - go to: https://discord.com/developers/applications * - click: "New Application" * - give a name → Create * * 2. adding the Bot to the app * - on the left: "Bot" → "Add Bot" → Yes, do it * * 3. getting the token * - on the same page: "Reset Token" → Copy * - put the token in the .env file: DISCORD_BOT_TOKEN=... * * 4. Bot ID (Client ID) and Invite link * - on the left: "OAuth2" > "URL Generator" * - Scopes: tick the bot * - Bot Permissions: pl. Send Messages, Read Message History * - at the bottom: generate Invite URL → open it → add it to a server * - the Client ID is on the same page, the "Application ID" on the "OAuth2 > General" or "Application" tab. * - it only works if you are admin on that server or have "Manage Server" permissions. * * 5. Permissions * - on the left: "Bot" tab * - enable these: * - MESSAGE CONTENT INTENT * - PRESENCE INTENT (if you use it) * - SERVER MEMBERS INTENT (if you need guild user info) * - Save * */ export declare abstract class DyNTS_DiBo_Main_ControlService extends DyNTS_SingletonService { readonly client: Client; private _discordServer; get discordServer(): Guild; get botClientId(): string; get botDisplayName(): string; protected botIO_CS: DyNTS_DiBo_IO_ControlService; protected abstract getBotIOControlService(): DyNTS_DiBo_IO_ControlService; protected routines_CS: DyNTS_DiBo_Routines_ControlService; protected abstract getRoutinesControlService(): DyNTS_DiBo_Routines_ControlService; protected commands_CS: DyNTS_DiBo_Commands_ControlService; protected abstract getCommandsControlService(): DyNTS_DiBo_Commands_ControlService; private _channelsByNames; private _rolesByNames; protected debugLog: boolean; protected constructor(setupAutomatically?: boolean); setup(issuer: string): Promise; start(issuer: string): Promise; getRolePingByName(roleName: string): Promise; getRolePingsByName(roleNames: string[]): Promise; getRoleByName(roleName: string): Role; getChannelByName(channelName: string): TextChannel; sendMessageToChannelByName(channelName: string, message: string, issuer: string): Promise; clearChannel(channel: TextChannel, issuer: string): Promise; } /** * A leggyakoribb client.on(...) események a következők (TypeScript + discord.js 14+): * * 🔁 Alap események * client.on('ready', () => {}) // Bot elindult * client.on('messageCreate', (msg) => {}) // Üzenet érkezett * client.on('interactionCreate', (i) => {}) // Slash command vagy gomb stb. * client.on('guildCreate', (guild) => {}) // Új szerverre került * client.on('guildDelete', (guild) => {}) // Szerverről eltávolították * client.on('error', (err) => {}) // Hiba történt * * 👥 Felhasználókkal kapcsolatos események * client.on('guildMemberAdd', (member) => {}) // Új user csatlakozott * client.on('guildMemberRemove', (member) => {}) // User kilépett * client.on('presenceUpdate', (oldP, newP) => {})// Status változott (pl. online → idle) * ✏️ Üzenet események * client.on('messageUpdate', (oldMsg, newMsg) => {}) // Üzenet módosult * client.on('messageDelete', (msg) => {}) // Üzenetet töröltek * * 🔧 Moderáció/jogosultság/stb. * client.on('roleCreate', (role) => {}) * client.on('roleDelete', (role) => {}) * client.on('channelCreate', (ch) => {}) * client.on('channelDelete', (ch) => {}) */ //# sourceMappingURL=dibo-main.control-service.d.ts.map