From b4fdd8b9ed58d0ad5dba32b90ee8aecc1a127b1f Mon Sep 17 00:00:00 2001 From: Skip R Date: Wed, 21 Jan 2026 06:54:58 -0800 Subject: [PATCH] connector: don't crash upon less than 10 private channels --- pkg/connector/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/connector/client.go b/pkg/connector/client.go index fcd1806..0473dc3 100644 --- a/pkg/connector/client.go +++ b/pkg/connector/client.go @@ -213,7 +213,11 @@ func (d *DiscordClient) syncPrivateChannels(ctx context.Context) { }) // TODO(skip): This is startup_private_channel_create_limit. Support this in the config. - for _, dm := range dms[:10] { + maxDms := 10 + if maxDms > len(dms) { + maxDms = len(dms) + } + for _, dm := range dms[:maxDms] { zerolog.Ctx(ctx).Debug().Str("channel_id", dm.ID).Msg("Syncing private channel with recent activity") d.syncChannel(ctx, dm) }