aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moulberry-bush
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-26 18:45:31 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-26 18:45:31 -0400
commitcca0b7a03bcd61af12b7f9bff51276f6c70beeb3 (patch)
tree2b2adebc166ac033520e5b582773e63fbdc5ddb9 /src/commands/moulberry-bush
parent13ba1ad552047eb9386e91d542a975c4bef58b08 (diff)
downloadtanzanite-cca0b7a03bcd61af12b7f9bff51276f6c70beeb3.tar.gz
tanzanite-cca0b7a03bcd61af12b7f9bff51276f6c70beeb3.tar.bz2
tanzanite-cca0b7a03bcd61af12b7f9bff51276f6c70beeb3.zip
refactor: this.client.util -> util
Diffstat (limited to 'src/commands/moulberry-bush')
-rw-r--r--src/commands/moulberry-bush/capePerms.ts20
-rw-r--r--src/commands/moulberry-bush/giveawayPing.ts2
-rw-r--r--src/commands/moulberry-bush/report.ts14
3 files changed, 13 insertions, 23 deletions
diff --git a/src/commands/moulberry-bush/capePerms.ts b/src/commands/moulberry-bush/capePerms.ts
index 08b42ff..d613217 100644
--- a/src/commands/moulberry-bush/capePerms.ts
+++ b/src/commands/moulberry-bush/capePerms.ts
@@ -52,11 +52,9 @@ export default class CapePermissionsCommand extends BushCommand {
let capeperms: Capeperms, uuid: string;
try {
- uuid = await this.client.util.findUUID(args.ign);
+ uuid = await util.findUUID(args.ign);
} catch (e) {
- return await message.util.reply(
- `${this.client.util.emojis.error} \`${args.ign}\` doesn't appear to be a valid username.`
- );
+ return await message.util.reply(`${util.emojis.error} \`${args.ign}\` doesn't appear to be a valid username.`);
}
try {
@@ -65,9 +63,7 @@ export default class CapePermissionsCommand extends BushCommand {
capeperms = null;
}
if (capeperms == null) {
- return await message.util.reply(
- `${this.client.util.emojis.error} There was an error finding cape perms for \`${args.ign}\`.`
- );
+ return await message.util.reply(`${util.emojis.error} There was an error finding cape perms for \`${args.ign}\`.`);
} else {
if (capeperms?.perms) {
let index = null;
@@ -80,19 +76,15 @@ export default class CapePermissionsCommand extends BushCommand {
continue;
}
if (index == null)
- return await message.util.reply(
- `${this.client.util.emojis.error} \`${args.ign}\` does not appear to have any capes.`
- );
+ return await message.util.reply(`${util.emojis.error} \`${args.ign}\` does not appear to have any capes.`);
const userPerm: string[] = capeperms.perms[index].perms;
const embed = new MessageEmbed()
.setTitle(`${args.ign}'s Capes`)
.setDescription(userPerm.join('\n'))
- .setColor(this.client.util.colors.default);
+ .setColor(util.colors.default);
await message.util.reply({ embeds: [embed] });
} else {
- return await message.util.reply(
- `${this.client.util.emojis.error} There was an error finding cape perms for ${args.ign}.`
- );
+ return await message.util.reply(`${util.emojis.error} There was an error finding cape perms for ${args.ign}.`);
}
}
}
diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts
index 93373b0..269c33f 100644
--- a/src/commands/moulberry-bush/giveawayPing.ts
+++ b/src/commands/moulberry-bush/giveawayPing.ts
@@ -25,7 +25,7 @@ export default class GiveawayPingCommand extends BushCommand {
public async exec(message: BushMessage): Promise<unknown> {
if (!message.member.permissions.has('MANAGE_GUILD'))
- await message.util.reply(`${this.client.util.emojis.error} You are missing the \`manage server\` permission.`);
+ await message.util.reply(`${util.emojis.error} You are missing the \`manage server\` permission.`);
await message.delete().catch(() => {});
diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts
index ebc8f1d..11ef269 100644
--- a/src/commands/moulberry-bush/report.ts
+++ b/src/commands/moulberry-bush/report.ts
@@ -59,17 +59,15 @@ export default class ReportCommand extends BushCommand {
public async exec(message: BushMessage, { member, evidence }: { member: GuildMember; evidence: string }): Promise<unknown> {
if (message.guild.id != this.client.consts.mappings.guilds.bush)
- return await message.util.reply(`${this.client.util.emojis.error} This command can only be run in Moulberry's bush.`);
- if (!member) return await message.util.reply(`${this.client.util.emojis.error} Choose someone to report`);
+ return await message.util.reply(`${util.emojis.error} This command can only be run in Moulberry's bush.`);
+ if (!member) return await message.util.reply(`${util.emojis.error} Choose someone to report`);
if (member.user.id === '322862723090219008')
return await message.util.reply({
content: `Thank you for your report! We take these allegations very seriously and have reported <@${member.user.id}> to the FBI!`,
allowedMentions: AllowedMentions.none()
});
if (member.user.bot)
- return await message.util.reply(
- `${this.client.util.emojis.error} You cannot report a bot <:WeirdChamp:756283321301860382>.`
- );
+ return await message.util.reply(`${util.emojis.error} You cannot report a bot <:WeirdChamp:756283321301860382>.`);
//// if (!evidence) evidence = 'No Evidence.';
//todo: Add channel id to db instead of hard coding it & allow in any guild
@@ -79,7 +77,7 @@ export default class ReportCommand extends BushCommand {
.setTimestamp()
.setAuthor(`Report From: ${message.author.tag}`, message.author.avatarURL({ dynamic: true }))
.setTitle('New Report')
- .setColor(this.client.util.colors.red)
+ .setColor(util.colors.red)
.setDescription(evidence)
.addField(
'Reporter',
@@ -110,8 +108,8 @@ export default class ReportCommand extends BushCommand {
const reportChannel = <TextChannel>this.client.channels.cache.get('782972723654688848');
await reportChannel.send({ embeds: [reportEmbed] }).then(async (ReportMessage) => {
try {
- await ReportMessage.react(this.client.util.emojis.success);
- await ReportMessage.react(this.client.util.emojis.error);
+ await ReportMessage.react(util.emojis.success);
+ await ReportMessage.react(util.emojis.error);
} catch {
this.client.console.warn('ReportCommand', 'Could not react to report message.');
}