Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/undiscord-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,12 @@ class UndiscordCore {

await wait(w * 2);
return await this.search();
}
else {
} else if (resp.status === 403) {
// insufficient permissions -- guild is empty or specific channel isn't accessible
log.warn(`API responded with 403 - Insufficient Permissions when searching for messages:\n`, await resp.json());
this.state._seachResponse = {messages:[]};
return this.state._seachResponse;
} else {
this.state.running = false;
log.error(`Error searching messages, API responded with status ${resp.status}!\n`, await resp.json());
throw resp;
Expand Down