feat: add booster eligibility role and logging functionality

- Added BOOSTER_ELIGIBILITY_ROLE_ID and LOG_LEVEL to .env.example and README.md
- Updated GitHub Actions workflow to include new environment variables
- Enhanced configuration loading to support booster eligibility role
- Implemented role checking logic in bot handlers and guild member updates
- Introduced logging using Winston for better traceability of actions
- Created tests for guild member update handling to ensure correct role removal
- Refactored DiscordRoleRepository to simplify role position resolution
This commit is contained in:
MythEclipse
2026-05-21 15:27:10 +07:00
parent bfa91063ff
commit cc6975825f
13 changed files with 162 additions and 22 deletions
+5 -1
View File
@@ -2,18 +2,22 @@ import { loadConfig } from "./config";
import { attachBotHandlers } from "./discord/bot";
import { createDiscordClient } from "./discord/client";
import { registerGuildCommandsWithToken } from "./discord/registerCommands";
import { logger } from "./logger";
const config = loadConfig();
logger.info("Registering guild commands", { guildId: config.discordGuildId });
await registerGuildCommandsWithToken(config.discordToken, {
clientId: config.discordClientId,
guildId: config.discordGuildId
});
logger.info("Guild commands registered", { guildId: config.discordGuildId });
const client = createDiscordClient();
attachBotHandlers(client, config);
client.once("clientReady", () => {
console.log(`Logged in as ${client.user?.tag ?? "unknown bot"}`);
logger.info("Discord client ready", { bot: client.user?.tag ?? "unknown bot" });
});
logger.info("Logging in Discord client");
await client.login(config.discordToken);