aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-26 18:47:13 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-26 18:47:13 -0400
commit80d5b5b11ae261945dc725a0a80115922003afcf (patch)
tree16c9f251b4d53456b4b5340c0203d35fd5870859 /src/commands/dev
parentcca0b7a03bcd61af12b7f9bff51276f6c70beeb3 (diff)
downloadtanzanite-80d5b5b11ae261945dc725a0a80115922003afcf.tar.gz
tanzanite-80d5b5b11ae261945dc725a0a80115922003afcf.tar.bz2
tanzanite-80d5b5b11ae261945dc725a0a80115922003afcf.zip
refactor: this.client -> client
Diffstat (limited to 'src/commands/dev')
-rw-r--r--src/commands/dev/eval.ts6
-rw-r--r--src/commands/dev/reload.ts8
-rw-r--r--src/commands/dev/say.ts2
-rw-r--r--src/commands/dev/servers.ts6
-rw-r--r--src/commands/dev/sh.ts2
-rw-r--r--src/commands/dev/superUser.ts2
-rw-r--r--src/commands/dev/test.ts4
7 files changed, 15 insertions, 15 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index 3966499..abdf2b9 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -80,13 +80,13 @@ export default class EvalCommand extends BushCommand {
const sh = promisify(exec),
me = message.member,
member = message.member,
- bot = this.client,
+ bot = client,
guild = message.guild,
channel = message.channel,
- config = this.client.config,
+ config = client.config,
members = message.guild?.members,
roles = message.guild?.roles,
- client = this.client,
+ client = client,
emojis = util.emojis,
colors = util.colors,
util = util,
diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts
index c930118..2be67fa 100644
--- a/src/commands/dev/reload.ts
+++ b/src/commands/dev/reload.ts
@@ -39,12 +39,12 @@ export default class ReloadCommand extends BushCommand {
try {
const s = new Date();
output = await util.shell(`yarn build-${fast ? 'esbuild' : 'tsc'}`);
- this.client.commandHandler.reloadAll();
- this.client.listenerHandler.reloadAll();
- this.client.inhibitorHandler.reloadAll();
+ client.commandHandler.reloadAll();
+ client.listenerHandler.reloadAll();
+ client.inhibitorHandler.reloadAll();
return message.util.send(`🔁 Successfully reloaded! (${new Date().getTime() - s.getTime()}ms)`);
} catch (e) {
- if (output) await this.client.logger.error('reloadCommand', output);
+ if (output) await client.logger.error('reloadCommand', output);
return message.util.send(`An error occurred while reloading:\n${await util.codeblock(e?.stack || e, 2048 - 34, 'js')}`);
}
}
diff --git a/src/commands/dev/say.ts b/src/commands/dev/say.ts
index 62ec96a..5042be4 100644
--- a/src/commands/dev/say.ts
+++ b/src/commands/dev/say.ts
@@ -37,7 +37,7 @@ export default class SayCommand extends BushCommand {
}
public async execSlash(message: AkairoMessage, { content }: { content: string }): Promise<unknown> {
- if (!this.client.config.owners.includes(message.author.id)) {
+ if (!client.config.owners.includes(message.author.id)) {
return await message.interaction.reply({
content: `${util.emojis.error} Only my developers can run this command.`,
ephemeral: true
diff --git a/src/commands/dev/servers.ts b/src/commands/dev/servers.ts
index c1bfdb7..dc4562c 100644
--- a/src/commands/dev/servers.ts
+++ b/src/commands/dev/servers.ts
@@ -19,7 +19,7 @@ export default class ServersCommand extends BushCommand {
public async exec(message: BushMessage | BushSlashMessage): Promise<unknown> {
const maxLength = 10;
- const guilds = this.client.guilds.cache.sort((a, b) => (a.memberCount < b.memberCount ? 1 : -1)).array();
+ const guilds = client.guilds.cache.sort((a, b) => (a.memberCount < b.memberCount ? 1 : -1)).array();
const chunkedGuilds: Guild[][] = [];
const embeds: MessageEmbed[] = [];
@@ -30,14 +30,14 @@ export default class ServersCommand extends BushCommand {
chunkedGuilds.forEach((c: Guild[]) => {
const embed = new MessageEmbed();
c.forEach((g: Guild) => {
- const owner = this.client.users.cache.get(g.ownerId)?.tag;
+ const owner = client.users.cache.get(g.ownerId)?.tag;
embed
.addField(
`**${g.name}**`,
`**ID:** ${g.id}\n**Owner:** ${owner ? owner : g.ownerId}\n**Members:** ${g.memberCount.toLocaleString()}`,
false
)
- .setTitle(`Server List [${this.client.guilds.cache.size}]`)
+ .setTitle(`Server List [${client.guilds.cache.size}]`)
.setColor(util.colors.default);
});
embeds.push(embed);
diff --git a/src/commands/dev/sh.ts b/src/commands/dev/sh.ts
index acbbfdc..ed1dfd7 100644
--- a/src/commands/dev/sh.ts
+++ b/src/commands/dev/sh.ts
@@ -38,7 +38,7 @@ export default class ShCommand extends BushCommand {
}
public async exec(message: BushMessage | BushSlashMessage, { command }: { command: string }): Promise<unknown> {
- if (!this.client.config.owners.includes(message.author.id))
+ if (!client.config.owners.includes(message.author.id))
return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`);
const input = clean(command);
diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts
index cc1519f..9071a8d 100644
--- a/src/commands/dev/superUser.ts
+++ b/src/commands/dev/superUser.ts
@@ -43,7 +43,7 @@ export default class SuperUserCommand extends BushCommand {
if (!message.author.isOwner())
return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`);
- const superUsers = (await Global.findByPk(this.client.config.environment)).superUsers;
+ const superUsers = (await Global.findByPk(client.config.environment)).superUsers;
let success;
if (args.action === 'add') {
if (superUsers.includes(args.user.id)) {
diff --git a/src/commands/dev/test.ts b/src/commands/dev/test.ts
index f7edda2..3a27be0 100644
--- a/src/commands/dev/test.ts
+++ b/src/commands/dev/test.ts
@@ -128,7 +128,7 @@ export default class TestCommand extends BushCommand {
return await message.util.reply({ content: 'this is content', components: ButtonRows, embeds });
} else if (['delete slash commands'].includes(args?.feature?.toLowerCase())) {
// let guildCommandCount = 0;
- // this.client.guilds.cache.forEach(guild =>
+ // client.guilds.cache.forEach(guild =>
// guild.commands.fetch().then(commands => {
// commands.forEach(async command => {
// await command.delete();
@@ -138,7 +138,7 @@ export default class TestCommand extends BushCommand {
// );
const guildCommands = await message.guild.commands.fetch();
guildCommands.forEach(async (command) => await command.delete());
- const globalCommands = await this.client.application.commands.fetch();
+ const globalCommands = await client.application.commands.fetch();
globalCommands.forEach(async (command) => await command.delete());
return await message.util.reply(