mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-18 13:34:14 +02:00
fix(arabot): catch conditions for fetching guild and user
This commit is contained in:
parent
cf8142b86a
commit
5793bbb461
@ -32,7 +32,7 @@ export class VerifyUnblock extends ScheduledTask {
|
|||||||
// Get the guild where the user is in
|
// Get the guild where the user is in
|
||||||
let guild = this.container.client.guilds.cache.get(payload.guildId);
|
let guild = this.container.client.guilds.cache.get(payload.guildId);
|
||||||
if (guild === undefined) {
|
if (guild === undefined) {
|
||||||
guild = await this.container.client.guilds.fetch(payload.guildId);
|
guild = await this.container.client.guilds.fetch(payload.guildId).catch(() => undefined);
|
||||||
if (guild === undefined) {
|
if (guild === undefined) {
|
||||||
this.container.logger.error('verifyUnblock: Guild not found!');
|
this.container.logger.error('verifyUnblock: Guild not found!');
|
||||||
return;
|
return;
|
||||||
@ -42,7 +42,7 @@ export class VerifyUnblock extends ScheduledTask {
|
|||||||
// Find GuildMember for the user
|
// Find GuildMember for the user
|
||||||
let user = guild.members.cache.get(payload.userId);
|
let user = guild.members.cache.get(payload.userId);
|
||||||
if (user === undefined) {
|
if (user === undefined) {
|
||||||
user = await guild.members.fetch(payload.userId).catch(undefined);
|
user = await guild.members.fetch(payload.userId).catch(() => undefined);
|
||||||
if (user === undefined) {
|
if (user === undefined) {
|
||||||
this.container.logger.error('verifyUnblock: GuildMember not found!');
|
this.container.logger.error('verifyUnblock: GuildMember not found!');
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user