aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moulberry-bush
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-05-28 20:13:49 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-05-28 20:13:49 -0400
commit25cf269e2e793de5fefb9aa3f19fb167168e06c6 (patch)
treecd5f2f3c097a84a2483a70b57b3cbba7b6f4a6be /src/commands/moulberry-bush
parente220f8462bbfb26e3237df34923be4acc5d83fee (diff)
downloadtanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.tar.gz
tanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.tar.bz2
tanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.zip
stuff
Diffstat (limited to 'src/commands/moulberry-bush')
-rw-r--r--src/commands/moulberry-bush/capePerms.ts16
-rw-r--r--src/commands/moulberry-bush/giveawayPing.ts22
-rw-r--r--src/commands/moulberry-bush/level.ts9
-rw-r--r--src/commands/moulberry-bush/rule.ts60
4 files changed, 25 insertions, 82 deletions
diff --git a/src/commands/moulberry-bush/capePerms.ts b/src/commands/moulberry-bush/capePerms.ts
index 92ccd73..79f9d6b 100644
--- a/src/commands/moulberry-bush/capePerms.ts
+++ b/src/commands/moulberry-bush/capePerms.ts
@@ -58,8 +58,7 @@ export default class CapePermissionsCommand extends BushCommand {
type: 'string',
prompt: {
start: 'Who would you like to see the cape permissions of?',
- retry:
- '<:error:837123021016924261> Choose someone to see the capes their available capes.',
+ retry: '<:error:837123021016924261> Choose someone to see the capes their available capes.',
optional: false
}
}
@@ -94,13 +93,9 @@ export default class CapePermissionsCommand extends BushCommand {
} else {
if (capeperms?.perms) {
const foundUser = capeperms.perms.find((u) => u._id === uuid);
- if (foundUser == null)
- return `<:error:837123021016924261> \`${user}\` does not appear to have any capes.`;
+ if (foundUser == null) return `<:error:837123021016924261> \`${user}\` does not appear to have any capes.`;
const userPerm: string[] = foundUser.perms;
- const embed = this.client.util
- .createEmbed(this.client.util.colors.default)
- .setTitle(`${user}'s Capes`)
- .setDescription(userPerm.join('\n'));
+ const embed = this.client.util.createEmbed(this.client.util.colors.default).setTitle(`${user}'s Capes`).setDescription(userPerm.join('\n'));
return embed;
} else {
return `<:error:837123021016924261> There was an error finding cape perms for ${user}.`;
@@ -111,10 +106,7 @@ export default class CapePermissionsCommand extends BushCommand {
await message.reply(await this.getResponse(user));
}
- public async execSlash(
- message: CommandInteraction,
- { user }: { user: SlashCommandOption<string> }
- ): Promise<void> {
+ public async execSlash(message: CommandInteraction, { user }: { user: SlashCommandOption<string> }): Promise<void> {
await message.reply(await this.getResponse(user.value));
}
}
diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts
index 06cb254..e11585a 100644
--- a/src/commands/moulberry-bush/giveawayPing.ts
+++ b/src/commands/moulberry-bush/giveawayPing.ts
@@ -15,14 +15,7 @@ export default class GiveawayPingCommand extends BushCommand {
examples: ['giveawayping']
},
clientPermissions: ['MANAGE_MESSAGES'],
- userPermissions: [
- 'SEND_MESSAGES',
- 'MANAGE_GUILD',
- 'MANAGE_MESSAGES',
- 'BAN_MEMBERS',
- 'KICK_MEMBERS',
- 'VIEW_CHANNEL'
- ],
+ userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD', 'MANAGE_MESSAGES', 'BAN_MEMBERS', 'KICK_MEMBERS', 'VIEW_CHANNEL'],
channel: 'guild',
ignoreCooldown: [],
ignorePermissions: [],
@@ -32,21 +25,14 @@ export default class GiveawayPingCommand extends BushCommand {
});
}
public async exec(message: Message): Promise<unknown> {
- if (message.guild.id !== '516977525906341928')
- return message.reply(
- "<:error:837123021016924261> This command may only be run in Moulberry's Bush."
- );
+ if (message.guild.id !== '516977525906341928') return message.reply("<:error:837123021016924261> This command may only be run in Moulberry's Bush.");
if (!['767782084981817344', '833855738501267456'].includes(message.channel.id))
- return message.reply(
- '<:error:837123021016924261> This command may only be run in giveaway channels.'
- );
+ return message.reply('<:error:837123021016924261> This command may only be run in giveaway channels.');
await message.delete().catch(() => undefined);
const webhooks = await (message.channel as TextChannel | NewsChannel).fetchWebhooks();
let webhookClient: WebhookClient;
if (webhooks.size < 1) {
- const webhook = await (message.channel as TextChannel | NewsChannel).createWebhook(
- 'Giveaway ping webhook'
- );
+ const webhook = await (message.channel as TextChannel | NewsChannel).createWebhook('Giveaway ping webhook');
webhookClient = new WebhookClient(webhook.id, webhook.token);
} else {
const webhook = webhooks.first();
diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts
index 74d6cf4..2b32abd 100644
--- a/src/commands/moulberry-bush/level.ts
+++ b/src/commands/moulberry-bush/level.ts
@@ -41,9 +41,7 @@ export default class LevelCommand extends BushCommand {
private async getResponse(user: User): Promise<string> {
const userLevelRow = await Level.findByPk(user.id);
if (userLevelRow) {
- return `${user ? `${user.tag}'s` : 'Your'} level is ${userLevelRow.level} (${
- userLevelRow.xp
- } XP)`;
+ return `${user ? `${user.tag}'s` : 'Your'} level is ${userLevelRow.level} (${userLevelRow.xp} XP)`;
} else {
return `${user ? `${user.tag} does` : 'You do'} not have a level yet!`;
}
@@ -52,10 +50,7 @@ export default class LevelCommand extends BushCommand {
async exec(message: Message, { user }: { user?: User }): Promise<void> {
await message.reply(await this.getResponse(user || message.author));
}
- async execSlash(
- message: CommandInteraction,
- { user }: { user?: CommandInteractionOption }
- ): Promise<void> {
+ async execSlash(message: CommandInteraction, { user }: { user?: CommandInteractionOption }): Promise<void> {
await message.reply(await this.getResponse(user?.user || message.user));
}
}
diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts
index 6984603..e3f9e34 100644
--- a/src/commands/moulberry-bush/rule.ts
+++ b/src/commands/moulberry-bush/rule.ts
@@ -19,28 +19,23 @@ export default class RuleCommand extends BushCommand {
},
{
title: 'No Spamming',
- description:
- 'Including but not limited to: any messages that do not contribute to the conversation, repeated messages, randomly tagging users, and chat flood.'
+ description: 'Including but not limited to: any messages that do not contribute to the conversation, repeated messages, randomly tagging users, and chat flood.'
},
{
title: 'English',
- description:
- 'The primary language of the server is English, please keep all discussions in English.'
+ description: 'The primary language of the server is English, please keep all discussions in English.'
},
{
title: 'Safe for Work',
- description:
- 'Please keep NSFW and NSFL content out of this server, avoid borderline images as well as keeping your status and profile picture SFW.'
+ description: 'Please keep NSFW and NSFL content out of this server, avoid borderline images as well as keeping your status and profile picture SFW.'
},
{
title: 'No Advertising',
- description:
- 'Do not promote anything without prior approval from a staff member, this includes DM advertising.'
+ description: 'Do not promote anything without prior approval from a staff member, this includes DM advertising.'
},
{
title: 'Impersonation',
- description:
- 'Do not try to impersonate others for the express intent of being deceitful, defamation , and/or personal gain.'
+ description: 'Do not try to impersonate others for the express intent of being deceitful, defamation , and/or personal gain.'
},
{
title: 'Swearing',
@@ -48,23 +43,19 @@ export default class RuleCommand extends BushCommand {
},
{
title: 'Only ping @emergency in emergencies',
- description:
- 'Pinging <@&833802660209229854> for no reason will result in severe punishment. <@&833802660209229854> is only to be pinged in true emergencies.'
+ description: 'Pinging <@&833802660209229854> for no reason will result in severe punishment. <@&833802660209229854> is only to be pinged in true emergencies.'
},
{
title: 'No Backseat Moderating',
- description:
- 'If you see a rule being broken be broken, please report it using: `-report <user> [evidence]`.'
+ description: 'If you see a rule being broken be broken, please report it using: `-report <user> [evidence]`.'
},
{
title: 'Staff may moderate at their discretion',
- description:
- 'If there are loopholes in our rules, the staff team may moderate based on what they deem appropriate. The staff team holds final discretion.'
+ description: 'If there are loopholes in our rules, the staff team may moderate based on what they deem appropriate. The staff team holds final discretion.'
},
{
title: "Sending media that are able to crash a user's Discord",
- description:
- "Sending videos, GIFs, emojis, etc. that are able to crash someone's discord will result in a **permanent** mute that cannot be appealed."
+ description: "Sending videos, GIFs, emojis, etc. that are able to crash someone's discord will result in a **permanent** mute that cannot be appealed."
}
];
@@ -117,35 +108,20 @@ export default class RuleCommand extends BushCommand {
]
});
}
- private getResponse(
- message: Message | CommandInteraction,
- rule?: number,
- user?: User
- ): string | MessageEmbed | [string, MessageEmbed] {
- if (
- message.guild.id !== '516977525906341928' &&
- !this.client.ownerID.includes(
- message instanceof Message ? message.author.id : message.user.id
- )
- ) {
+ private getResponse(message: Message | CommandInteraction, rule?: number, user?: User): string | MessageEmbed | [string, MessageEmbed] {
+ if (message.guild.id !== '516977525906341928' && !this.client.ownerID.includes(message instanceof Message ? message.author.id : message.user.id)) {
return "<:no:787549684196704257> This command can only be run in Moulberry's Bush.";
}
let rulesEmbed = new MessageEmbed().setColor('ef3929');
if (message instanceof Message) {
- rulesEmbed = rulesEmbed.setFooter(
- `Triggered by ${message.author.tag}`,
- message.author.avatarURL({ dynamic: true })
- );
+ rulesEmbed = rulesEmbed.setFooter(`Triggered by ${message.author.tag}`, message.author.avatarURL({ dynamic: true }));
}
if (rule) {
const foundRule = this.rules[rule - 1];
rulesEmbed.addField(`${rule}) ${foundRule.title}`, foundRule.description);
} else {
for (const curRule of this.rules) {
- rulesEmbed.addField(
- `${this.rules.indexOf(curRule) + 1}) ${curRule.title}`,
- curRule.description
- );
+ rulesEmbed.addField(`${this.rules.indexOf(curRule) + 1}) ${curRule.title}`, curRule.description);
}
}
if (!user) {
@@ -154,10 +130,7 @@ export default class RuleCommand extends BushCommand {
return [`<@!${user.id}>`, rulesEmbed];
}
}
- public async exec(
- message: Message,
- { rule, user }: { rule?: number; user?: User }
- ): Promise<void> {
+ public async exec(message: Message, { rule, user }: { rule?: number; user?: User }): Promise<void> {
const response = this.getResponse(message, rule, user);
if (Array.isArray(response)) {
await message.util.send(response[0], {
@@ -169,10 +142,7 @@ export default class RuleCommand extends BushCommand {
await message.delete().catch(() => undefined);
}
- public async execSlash(
- message: CommandInteraction,
- { rule, user }: { rule?: SlashCommandOption<number>; user?: SlashCommandOption<void> }
- ): Promise<void> {
+ public async execSlash(message: CommandInteraction, { rule, user }: { rule?: SlashCommandOption<number>; user?: SlashCommandOption<void> }): Promise<void> {
const response = this.getResponse(message, rule?.value, user?.user);
if (Array.isArray(response)) {
await message.reply(response[0], {