From 1a502d00f2fdfe1539ee96c0cc1fdcaa4e9535a6 Mon Sep 17 00:00:00 2001 From: Wiktoria Van Harneveldt Date: Tue, 4 Nov 2025 21:25:38 +0100 Subject: [PATCH] fix: enhance error handling for guide synchronization to provide specific warnings for permission issues --- src/events/ready.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/events/ready.ts b/src/events/ready.ts index 17304e0..5a50475 100644 --- a/src/events/ready.ts +++ b/src/events/ready.ts @@ -30,7 +30,18 @@ export const readyEvent = createEvent( console.log(`🔄 Starting guide sync to channel ${config.guides.channelId}...`); await syncGuidesToChannel(client, config.guides.channelId); } catch (error) { - console.error('❌ Failed to sync guides:', error); + if (error && typeof error === 'object' && 'code' in error) { + const discordError = error as { code: number; message?: string }; + if (discordError.code === 50001) { + console.warn( + '⚠️ Bot does not have access to the guides channel. Please check bot permissions and channel ID.' + ); + } else { + console.error('❌ Failed to sync guides:', error); + } + } else { + console.error('❌ Failed to sync guides:', error); + } } } }