zustand auf server wiederhergestellt

This commit is contained in:
2026-01-09 08:43:18 +01:00
parent 1010fe7d11
commit f2f9e02fb2
30 changed files with 6403 additions and 139 deletions

View File

@@ -20,7 +20,9 @@ const serverDisplay = {
factorio: { name: 'Factorio', icon: '⚙️', color: 0xF97316, address: 'factorio.zeasy.dev' },
zomboid: { name: 'Project Zomboid', icon: '🧟', color: 0x4ADE80, address: 'pz.zeasy.dev:16261' },
vrising: { name: 'V Rising', icon: '🧛', color: 0xDC2626, address: 'vrising.zeasy.dev' },
palworld: { name: 'Palworld', icon: '🦎', color: 0x00D4AA, address: 'palworld.zeasy.dev:8211' }
palworld: { name: 'Palworld', icon: '🦎', color: 0x00D4AA, address: 'palworld.zeasy.dev:8211' },
terraria: { name: 'Terraria', icon: '⚔️', color: 0x05C46B, address: 'terraria.zeasy.dev:7777' },
openttd: { name: 'OpenTTD', icon: '🚂', color: 0x1E90FF, address: 'openttd.zeasy.dev:3979' }
};
function loadConfig() {
@@ -497,17 +499,28 @@ export async function initDiscordBot() {
console.log('[DiscordBot] Left guild: ' + guild.name + ' (' + guild.id + ')');
deleteGuildSettings(guild.id);
});
client.once('ready', async () => {
console.log('[DiscordBot] Logged in as ' + client.user.tag);
// Check for guilds without settings and set them up
for (const [guildId, guild] of client.guilds.cache) {
const settings = getGuildSettings(guildId);
if (!settings) {
console.log('[DiscordBot] Setting up missing guild: ' + guild.name);
try {
await setupGuildChannels(guild);
} catch (err) {
console.error('[DiscordBot] Failed to setup missing guild ' + guild.name + ':', err);
}
}
}
// First run - populate state without alerts
await updateAllStatusMessages(true);
// Regular updates every 60 seconds
setInterval(() => updateAllStatusMessages(false), 60000);
});
client.login(token).catch(err => {
console.error('[DiscordBot] Failed to login:', err.message);
});