aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-08-20 23:07:02 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-08-20 23:07:02 -0400
commitb81f9e8b73cb520ad5ae916c3e571ea55f4ca489 (patch)
tree25d7f42d66c3e3190022ece043c86082a9e85709 /src/commands/dev
parentf2e5cfff7dc275bd93fac446a508b7d18ecd6c58 (diff)
downloadtanzanite-b81f9e8b73cb520ad5ae916c3e571ea55f4ca489.tar.gz
tanzanite-b81f9e8b73cb520ad5ae916c3e571ea55f4ca489.tar.bz2
tanzanite-b81f9e8b73cb520ad5ae916c3e571ea55f4ca489.zip
fix ts composite shit, replace got with native fetch, update deps
Diffstat (limited to 'src/commands/dev')
-rw-r--r--src/commands/dev/eval.ts3
-rw-r--r--src/commands/dev/reload.ts15
-rw-r--r--src/commands/dev/syncAutomod.ts11
3 files changed, 9 insertions, 20 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index 04db2eb..fdef3ac 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -45,7 +45,6 @@ import {
ReactionCollector,
SelectMenuComponent
} from 'discord.js';
-import got from 'got';
import path from 'path';
import ts from 'typescript';
import { fileURLToPath } from 'url';
@@ -57,7 +56,7 @@ const { transpile } = ts,
/* eslint-enable @typescript-eslint/no-unused-vars */
// prettier-ignore
-assertAll(ActivePunishment, BushCommand, Global, Guild, Level, ModLog, Shared, StickyRole, Snowflake_, Canvas, exec, ActionRow, ButtonComponent, ButtonInteraction, Collection, Collector, CommandInteraction, ContextMenuCommandInteraction, DMChannel, Embed, Emoji, InteractionCollector, Message, Attachment, MessageCollector, OAuth2Scopes, PermissionFlagsBits, PermissionsBitField, ReactionCollector, SelectMenuComponent, path, ts, fileURLToPath, promisify, assert, got, transpile, sh, SnowflakeUtil, __dirname);
+assertAll(ActivePunishment, BushCommand, Global, Guild, Level, ModLog, Shared, StickyRole, Snowflake_, Canvas, exec, ActionRow, ButtonComponent, ButtonInteraction, Collection, Collector, CommandInteraction, ContextMenuCommandInteraction, DMChannel, Embed, Emoji, InteractionCollector, Message, Attachment, MessageCollector, OAuth2Scopes, PermissionFlagsBits, PermissionsBitField, ReactionCollector, SelectMenuComponent, path, ts, fileURLToPath, promisify, assert, transpile, sh, SnowflakeUtil, __dirname);
export default class EvalCommand extends BushCommand {
public constructor() {
diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts
index 40d53eb..8125015 100644
--- a/src/commands/dev/reload.ts
+++ b/src/commands/dev/reload.ts
@@ -8,17 +8,6 @@ export default class ReloadCommand extends BushCommand {
description: 'Reloads the bot',
usage: ['reload'],
examples: ['reload'],
- // args: [
- // {
- // id: 'fast',
- // description: 'Whether or not to use esbuild for fast compiling.',
- // match: 'flag',
- // flag: ['--fast'],
- // prompt: 'Would you like to use esbuild for fast compiling?',
- // optional: true,
- // slashType: ApplicationCommandOptionType.Boolean
- // }
- // ],
ownerOnly: true,
typing: true,
slash: true,
@@ -27,13 +16,13 @@ export default class ReloadCommand extends BushCommand {
});
}
- public override async exec(message: CommandMessage | SlashMessage /* args: { fast: ArgType<'flag'> } */) {
+ public override async exec(message: CommandMessage | SlashMessage) {
if (!message.author.isOwner()) return await message.util.reply(`${emojis.error} Only my developers can run this command.`);
let output: { stdout: string; stderr: string };
try {
const s = new Date();
- output = await shell(`yarn build:${/* args.fast ? 'esbuild' : */ 'tsc'}`);
+ output = await shell(`yarn build`);
await Promise.all([
this.client.commandHandler.reloadAll(),
this.client.listenerHandler.reloadAll(),
diff --git a/src/commands/dev/syncAutomod.ts b/src/commands/dev/syncAutomod.ts
index c78e6c0..3dbd0be 100644
--- a/src/commands/dev/syncAutomod.ts
+++ b/src/commands/dev/syncAutomod.ts
@@ -1,5 +1,4 @@
import { BushCommand, clientSendAndPermCheck, emojis, Shared, type CommandMessage, type SlashMessage } from '#lib';
-import got from 'got';
import typescript from 'typescript';
import { NodeVM } from 'vm2';
@@ -22,10 +21,12 @@ 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 got.get('https://raw.githubusercontent.com/NotEnoughUpdates/bush-bot/master/src/lib/badlinks.ts'))
- .body;
- const badWords = (await got.get('https://raw.githubusercontent.com/NotEnoughUpdates/bush-bot/master/src/lib/badwords.ts'))
- .body;
+ const badLinks = await fetch('https://raw.githubusercontent.com/NotEnoughUpdates/bush-bot/master/src/lib/badlinks.ts').then(
+ (p) => p.text()
+ );
+ const badWords = await fetch('https://raw.githubusercontent.com/NotEnoughUpdates/bush-bot/master/src/lib/badwords.ts').then(
+ (p) => p.text()
+ );
const transpiledBadLinks = typescript.transpileModule(badLinks, {}).outputText;
const transpiledBadWords = typescript.transpileModule(badWords, {}).outputText;