Files
FWS-DiscordBot/src/events/client-ready.js
T
BlackAngelTV 6f3ec439d4 feat(gitea): recruit developers from a Discord panel into FWS
Recruited people need a Gitea account without a public signup on the forge.
The panel posts in its own Gitea category, the single modal keeps the whole
application in one gesture, and acceptance creates a restricted account in the
FWS organization, adds it to the Dev team, grants the Discord Dev role and
sends the temporary password by DM. Restrictions keep the new account working
inside the organization only, with no personal repository of its own.
2026-12-06 17:17:05 +01:00

37 lines
1.4 KiB
JavaScript

import { Events } from 'discord.js';
import { createLogger } from '../core/logger.js';
import { installRecruitmentPanel } from '../services/gitea/team-recruitment.js';
import { startPollScheduler } from '../services/polls/poll-service.js';
import { startBotStatusRotation } from '../services/status/bot-status-service.js';
import {
adoptOrphanVoiceChannels,
startVoiceJanitor,
sweepVoiceChannels,
} from '../services/voice/voice-service.js';
const log = createLogger('discord');
export const name = Events.ClientReady;
export const once = true;
export async function execute(client) {
startPollScheduler(client);
// Channels outlive the process: take back the ones the database forgot before
// the sweep decides they are not ours.
await adoptOrphanVoiceChannels(client).catch((error) =>
log.warn('Could not recover the orphan voice channels', error),
);
await sweepVoiceChannels(client);
startVoiceJanitor(client);
startBotStatusRotation(client);
// The Gitea recruitment salon is created on the first start and repaired on
// every later one; a permission problem must not keep the bot offline.
await installRecruitmentPanel(client).catch((error) =>
log.warn('Could not install the Gitea recruitment panel', error),
);
log.info(`Connected as ${client.user.tag}`, {
guilds: client.guilds.cache.size,
commands: client.commands.size,
});
}