diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-21 14:55:12 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-21 14:55:12 -0400 |
commit | 11d6fb8ecfca5c1a48fea32bf8a503eb9bb6107d (patch) | |
tree | 5649f880aaf16c3dd5599c9e042a64af6abe2445 | |
parent | 2609f5e1fc8cbe4c87f0090b76a3e5235cc7f6f8 (diff) | |
download | tanzanite-11d6fb8ecfca5c1a48fea32bf8a503eb9bb6107d.tar.gz tanzanite-11d6fb8ecfca5c1a48fea32bf8a503eb9bb6107d.tar.bz2 tanzanite-11d6fb8ecfca5c1a48fea32bf8a503eb9bb6107d.zip |
fix sync automod
-rw-r--r-- | src/commands/dev/syncAutomod.ts | 12 |
1 files changed, 8 insertions, 4 deletions
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; |