From 9d06b705e3ac1c83872733c1a4a268721ec499c3 Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Mon, 6 Dec 2021 03:50:27 +0000 Subject: [PATCH] feat: error handling for failed billing DMs --- src/commands/billing.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/billing.ts b/src/commands/billing.ts index de56760..795179b 100644 --- a/src/commands/billing.ts +++ b/src/commands/billing.ts @@ -46,7 +46,8 @@ export default class Billing extends Command { await redirect.save(); const chan = await this.client.getDMChannel(message.author.id); - await chan.createMessage(`__***Billing Account Portal***__\nClick here: https://loc.sh/${uid}\n\nYou will be redirected to your billing portal, please note the link expires after 5 minutes.`); + await chan.createMessage(`__***Billing Account Portal***__\nClick here: https://loc.sh/${uid}\n\nYou will be redirected to your billing portal, please note the link expires after 5 minutes.`) + .catch(() => { return this.error(message.channel, 'Failed to privately send your billing portal link to you.'); }); return await this.success(message.channel, 'Your Billing Portal information has been DMed to you.'); } catch (err) { return this.client.util.handleError(err, message, this);