connector: don't crash upon less than 10 private channels

This commit is contained in:
Skip R
2026-01-21 06:54:58 -08:00
parent 689f8b9998
commit b4fdd8b9ed

View File

@@ -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)
}