Skip to content

Commit 37faa64

Browse files
authored
Discord fix when channels are not avaliable (#1767)
1 parent b245cc6 commit 37faa64

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

services/libs/integrations/src/integrations/discord/api/getChannels.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ async function getChannels(
7373
const newErr = handleDiscordError(err, config, { input }, ctx)
7474
if (newErr) {
7575
throw newErr
76+
} else {
77+
return []
7678
}
7779
}
7880
}

services/libs/integrations/src/integrations/discord/processStream.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ const processRootStream: ProcessStreamHandler = async (ctx) => {
110110
ctx,
111111
)
112112

113+
if (fromDiscordApi.length === 0) {
114+
ctx.log.warn(`No avaliable channels found for guild ${guildId}, skipping...`)
115+
return
116+
}
117+
113118
for (const channel of fromDiscordApi) {
114119
try {
115120
const config = {

0 commit comments

Comments
 (0)