From 11d6fb8ecfca5c1a48fea32bf8a503eb9bb6107d Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sun, 21 Aug 2022 14:55:12 -0400 Subject: fix sync automod --- src/commands/dev/syncAutomod.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/commands/dev/syncAutomod.ts') diff --git a/src/commands/dev/syncAutomod.ts b/src/commands/dev/syncAutomod.ts index 3dbd0be..d0fc5e5 100644 --- a/src/commands/dev/syncAutomod.ts +++ b/src/commands/dev/syncAutomod.ts @@ -21,13 +21,17 @@ export default class SyncAutomodCommand extends BushCommand { if (!message.author.isOwner() && message.author.id !== '497789163555389441') return await message.util.reply(`${emojis.error} Only a very select few may use this command.`); - const badLinks = await fetch('https://raw.githubusercontent.com/NotEnoughUpdates/bush-bot/master/src/lib/badlinks.ts').then( - (p) => p.text() + const badLinks = await fetch('https://raw.githubusercontent.com/NotEnoughUpdates/bush-bot/master/lib/badlinks.ts').then((p) => + p.ok ? p.text() : null ); - const badWords = await fetch('https://raw.githubusercontent.com/NotEnoughUpdates/bush-bot/master/src/lib/badwords.ts').then( - (p) => p.text() + const badWords = await fetch('https://raw.githubusercontent.com/NotEnoughUpdates/bush-bot/master/lib/badwords.ts').then((p) => + p.ok ? p.text() : null ); + if (!badLinks || !badWords) { + return await message.util.reply(`${emojis.error} Failed to fetch bad links or bad words.`); + } + const transpiledBadLinks = typescript.transpileModule(badLinks, {}).outputText; const transpiledBadWords = typescript.transpileModule(badWords, {}).outputText; -- cgit