aboutsummaryrefslogtreecommitdiff
path: root/src/commands
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
parente220f8462bbfb26e3237df34923be4acc5d83fee (diff)
downloadtanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.tar.gz
tanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.tar.bz2
tanzanite-25cf269e2e793de5fefb9aa3f19fb167168e06c6.zip
stuff
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/dev/eval.ts31
-rw-r--r--src/commands/dev/setLevel.ts5
-rw-r--r--src/commands/info/botInfo.ts18
-rw-r--r--src/commands/info/help.ts26
-rw-r--r--src/commands/info/ping.ts4
-rw-r--r--src/commands/info/pronouns.ts23
-rw-r--r--src/commands/moderation/ban.ts45
-rw-r--r--src/commands/moderation/kick.ts26
-rw-r--r--src/commands/moderation/modlog.ts4
-rw-r--r--src/commands/moderation/role.ts85
-rw-r--r--src/commands/moderation/warn.ts5
-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
-rw-r--r--src/commands/server-config/prefix.ts5
16 files changed, 88 insertions, 296 deletions
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index cb7a95c..cfe75cc 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -5,10 +5,7 @@ import { inspect, promisify } from 'util';
import { exec } from 'child_process';
const clean = (text) => {
- if (typeof text === 'string')
- return text
- .replace(/`/g, '`' + String.fromCharCode(8203))
- .replace(/@/g, '@' + String.fromCharCode(8203));
+ if (typeof text === 'string') return text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203));
else return text;
};
@@ -50,10 +47,7 @@ export default class EvalCommand extends BushCommand {
});
}
- public async exec(
- message: Message,
- { depth, code, silent }: { depth: number; code: string; silent: boolean }
- ): Promise<void> {
+ public async exec(message: Message, { depth, code, silent }: { depth: number; code: string; silent: boolean }): Promise<void> {
const embed: MessageEmbed = new MessageEmbed();
try {
@@ -74,30 +68,15 @@ export default class EvalCommand extends BushCommand {
output = clean(output);
embed
.setTitle('✅ Evaled code successfully')
- .addField(
- '📥 Input',
- code.length > 1012
- ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(code))
- : '```js\n' + code + '```'
- )
- .addField(
- '📤 Output',
- output.length > 1012
- ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(output))
- : '```js\n' + output + '```'
- )
+ .addField('📥 Input', code.length > 1012 ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(code)) : '```js\n' + code + '```')
+ .addField('📤 Output', output.length > 1012 ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(output)) : '```js\n' + output + '```')
.setColor('#66FF00')
.setFooter(message.author.username, message.author.displayAvatarURL({ dynamic: true }))
.setTimestamp();
} catch (e) {
embed
.setTitle('❌ Code was not able to be evaled')
- .addField(
- '📥 Input',
- code.length > 1012
- ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(code))
- : '```js\n' + code + '```'
- )
+ .addField('📥 Input', code.length > 1012 ? 'Too large to display. Hastebin: ' + (await this.client.util.haste(code)) : '```js\n' + code + '```')
.addField(
'📤 Output',
e.length > 1012
diff --git a/src/commands/dev/setLevel.ts b/src/commands/dev/setLevel.ts
index e57e2f8..3a1bc85 100644
--- a/src/commands/dev/setLevel.ts
+++ b/src/commands/dev/setLevel.ts
@@ -73,10 +73,7 @@ export default class SetLevelCommand extends BushCommand {
});
}
- async execSlash(
- message: CommandInteraction,
- { user, level }: { user: SlashCommandOption<void>; level: SlashCommandOption<number> }
- ): Promise<void> {
+ async execSlash(message: CommandInteraction, { user, level }: { user: SlashCommandOption<void>; level: SlashCommandOption<number> }): Promise<void> {
await message.reply(await this.setLevel(user.user, level.value), {
allowedMentions: AllowedMentions.none()
});
diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts
index 0226edc..ebbd0c9 100644
--- a/src/commands/info/botInfo.ts
+++ b/src/commands/info/botInfo.ts
@@ -16,17 +16,9 @@ export default class BotInfoCommand extends BushCommand {
}
private async generateEmbed(): Promise<MessageEmbed> {
- const owners = (await this.client.util.mapIDs(this.client.ownerID))
- .map((u) => u.tag)
- .join('\n');
- const currentCommit = (await this.client.util.shell('git rev-parse HEAD')).stdout.replace(
- '\n',
- ''
- );
- const repoUrl = (await this.client.util.shell('git remote get-url origin')).stdout.replace(
- '\n',
- ''
- );
+ const owners = (await this.client.util.mapIDs(this.client.ownerID)).map((u) => u.tag).join('\n');
+ const currentCommit = (await this.client.util.shell('git rev-parse HEAD')).stdout.replace('\n', '');
+ const repoUrl = (await this.client.util.shell('git remote get-url origin')).stdout.replace('\n', '');
const embed = new MessageEmbed()
.setTitle('Bot Info:')
.addFields([
@@ -37,9 +29,7 @@ export default class BotInfoCommand extends BushCommand {
},
{
name: 'Uptime',
- value: this.client.util.capitalize(
- duration(this.client.uptime, 'milliseconds').humanize()
- )
+ value: this.client.util.capitalize(duration(this.client.uptime, 'milliseconds').humanize())
},
{
name: 'User count',
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts
index 7f91cdf..7f6c8f4 100644
--- a/src/commands/info/help.ts
+++ b/src/commands/info/help.ts
@@ -43,9 +43,7 @@ export default class HelpCommand extends BushCommand {
For additional info on a command, type \`${prefix}help <command>\`
`
)
- .setFooter(
- `For more information about a command use "${this.client.config.prefix}help <command>"`
- )
+ .setFooter(`For more information about a command use "${this.client.config.prefix}help <command>"`)
.setTimestamp();
for (const category of this.handler.categories.values()) {
embed.addField(
@@ -61,17 +59,10 @@ export default class HelpCommand extends BushCommand {
const embed = new MessageEmbed()
.setColor([155, 200, 200])
.setTitle(`\`${command.description.usage ? command.description.usage : ''}\``)
- .addField(
- 'Description',
- `${command.description.content ? command.description.content : ''} ${
- command.ownerOnly ? '\n__Owner Only__' : ''
- }`
- );
+ .addField('Description', `${command.description.content ? command.description.content : ''} ${command.ownerOnly ? '\n__Owner Only__' : ''}`);
- if (command.aliases.length > 1)
- embed.addField('Aliases', `\`${command.aliases.join('` `')}\``, true);
- if (command.description.examples && command.description.examples.length)
- embed.addField('Examples', `\`${command.description.examples.join('`\n`')}\``, true);
+ if (command.aliases.length > 1) embed.addField('Aliases', `\`${command.aliases.join('` `')}\``, true);
+ if (command.description.examples && command.description.examples.length) embed.addField('Examples', `\`${command.description.examples.join('`\n`')}\``, true);
return embed;
}
}
@@ -80,14 +71,9 @@ export default class HelpCommand extends BushCommand {
await message.util.send(this.generateEmbed(command));
}
- public async execSlash(
- message: CommandInteraction,
- { command }: { command: SlashCommandOption<string> }
- ): Promise<void> {
+ public async execSlash(message: CommandInteraction, { command }: { command: SlashCommandOption<string> }): Promise<void> {
if (command) {
- await message.reply(
- this.generateEmbed(this.handler.findCommand(command.value) as BushCommand)
- );
+ await message.reply(this.generateEmbed(this.handler.findCommand(command.value) as BushCommand));
} else {
await message.reply(this.generateEmbed());
}
diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts
index 9468722..b130e6d 100644
--- a/src/commands/info/ping.ts
+++ b/src/commands/info/ping.ts
@@ -18,9 +18,7 @@ export default class PingCommand extends BushCommand {
public async exec(message: Message): Promise<void> {
const sentMessage = await message.util.send('Pong!');
- const timestamp: number = message.editedTimestamp
- ? message.editedTimestamp
- : message.createdTimestamp;
+ const timestamp: number = message.editedTimestamp ? message.editedTimestamp : message.createdTimestamp;
const botLatency = `\`\`\`\n ${Math.floor(sentMessage.createdTimestamp - timestamp)}ms \`\`\``;
const apiLatency = `\`\`\`\n ${Math.round(message.client.ws.ping)}ms \`\`\``;
const embed = new MessageEmbed()
diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts
index ca70ff0..c53c542 100644
--- a/src/commands/info/pronouns.ts
+++ b/src/commands/info/pronouns.ts
@@ -59,15 +59,9 @@ export default class PronounsCommand extends BushCommand {
slashEmphemeral: true // I'll add dynamic checking to this later
});
}
- async sendResponse(
- message: Message | CommandInteraction,
- user: User,
- author: boolean
- ): Promise<void> {
+ async sendResponse(message: Message | CommandInteraction, user: User, author: boolean): Promise<void> {
try {
- const apiRes: { pronouns: pronounsType } = await got
- .get(`https://pronoundb.org/api/v1/lookup?platform=discord&id=${user.id}`)
- .json();
+ const apiRes: { pronouns: pronounsType } = await got.get(`https://pronoundb.org/api/v1/lookup?platform=discord&id=${user.id}`).json();
if (message instanceof Message) {
message.reply(
new MessageEmbed({
@@ -94,13 +88,9 @@ export default class PronounsCommand extends BushCommand {
} catch (e) {
if (e instanceof HTTPError && e.response.statusCode === 404) {
if (author) {
- await message.reply(
- 'You do not appear to have any pronouns set. Please go to https://pronoundb.org/ and set your pronouns.'
- );
+ await message.reply('You do not appear to have any pronouns set. Please go to https://pronoundb.org/ and set your pronouns.');
} else {
- await message.reply(
- `${user.tag} does not appear to have any pronouns set. Please tell them to go to https://pronoundb.org/ and set their pronouns.`
- );
+ await message.reply(`${user.tag} does not appear to have any pronouns set. Please tell them to go to https://pronoundb.org/ and set their pronouns.`);
}
} else throw e;
}
@@ -109,10 +99,7 @@ export default class PronounsCommand extends BushCommand {
const u = user || message.author;
await this.sendResponse(message, u, u.id === message.author.id);
}
- async execSlash(
- message: CommandInteraction,
- { user }: { user?: SlashCommandOption<void> }
- ): Promise<void> {
+ async execSlash(message: CommandInteraction, { user }: { user?: SlashCommandOption<void> }): Promise<void> {
const u = user?.user || message.user;
await this.sendResponse(message, u, u.id === message.user.id);
}
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts
index 05c26e0..e59a528 100644
--- a/src/commands/moderation/ban.ts
+++ b/src/commands/moderation/ban.ts
@@ -15,8 +15,7 @@ const durationAliases: Record<string, string[]> = {
minutes: ['m', 'min', 'mins', 'minutes', 'minute'],
months: ['mo', 'month', 'months']
};
-const durationRegex =
- /(?:(\d+)(d(?:ays?)?|h(?:ours?|rs?)?|m(?:inutes?|ins?)?|mo(?:nths?)?|w(?:eeks?|ks?)?)(?: |$))/g;
+const durationRegex = /(?:(\d+)(d(?:ays?)?|h(?:ours?|rs?)?|m(?:inutes?|ins?)?|mo(?:nths?)?|w(?:eeks?|ks?)?)(?: |$))/g;
export default class BanCommand extends BushCommand {
constructor() {
@@ -71,12 +70,7 @@ export default class BanCommand extends BushCommand {
]
});
}
- async *genResponses(
- message: Message | CommandInteraction,
- user: User,
- reason?: string,
- time?: string
- ): AsyncIterable<string> {
+ async *genResponses(message: Message | CommandInteraction, user: User, reason?: string, time?: string): AsyncIterable<string> {
const duration = moment.duration();
let modlogEnry: Modlog;
let banEntry: Ban;
@@ -99,14 +93,9 @@ export default class BanCommand extends BushCommand {
return;
}
for (const part of parsed) {
- const translated = Object.keys(durationAliases).find((k) =>
- durationAliases[k].includes(part[2])
- );
+ const translated = Object.keys(durationAliases).find((k) => durationAliases[k].includes(part[2]));
translatedTime.push(part[1] + ' ' + translated);
- duration.add(
- Number(part[1]),
- translated as 'weeks' | 'days' | 'hours' | 'months' | 'minutes'
- );
+ duration.add(Number(part[1]), translated as 'weeks' | 'days' | 'hours' | 'months' | 'minutes');
}
modlogEnry = Modlog.build({
user: user.id,
@@ -147,21 +136,17 @@ export default class BanCommand extends BushCommand {
}
try {
await user.send(
- `You were banned in ${message.guild.name} ${
- translatedTime.length >= 1 ? `for ${translatedTime.join(', ')}` : 'permanently'
- } with reason \`${reason || 'No reason given'}\``
+ `You were banned in ${message.guild.name} ${translatedTime.length >= 1 ? `for ${translatedTime.join(', ')}` : 'permanently'} with reason \`${
+ reason || 'No reason given'
+ }\``
);
} catch (e) {
yield 'Error sending message to user';
}
await message.guild.members.ban(user, {
- reason: `Banned by ${
- message instanceof CommandInteraction ? message.user.tag : message.author.tag
- } with ${reason ? `reason ${reason}` : 'no reason'}`
+ reason: `Banned by ${message instanceof CommandInteraction ? message.user.tag : message.author.tag} with ${reason ? `reason ${reason}` : 'no reason'}`
});
- yield `Banned <@!${user.id}> ${
- translatedTime.length >= 1 ? `for ${translatedTime.join(', ')}` : 'permanently'
- } with reason \`${reason || 'No reason given'}\``;
+ yield `Banned <@!${user.id}> ${translatedTime.length >= 1 ? `for ${translatedTime.join(', ')}` : 'permanently'} with reason \`${reason || 'No reason given'}\``;
} catch {
yield 'Error banning :/';
await banEntry.destroy();
@@ -169,10 +154,7 @@ export default class BanCommand extends BushCommand {
return;
}
}
- async exec(
- message: Message,
- { user, reason, time }: { user: User; reason?: string; time?: string }
- ): Promise<void> {
+ async exec(message: Message, { user, reason, time }: { user: User; reason?: string; time?: string }): Promise<void> {
for await (const response of this.genResponses(message, user, reason, time)) {
await message.util.send(response);
}
@@ -190,12 +172,7 @@ export default class BanCommand extends BushCommand {
time: SlashCommandOption<string>;
}
): Promise<void> {
- for await (const response of this.genResponses(
- message,
- user.user,
- reason?.value,
- time?.value
- )) {
+ for await (const response of this.genResponses(message, user.user, reason?.value, time?.value)) {
await message.reply(response);
}
}
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts
index f3ee44c..182485a 100644
--- a/src/commands/moderation/kick.ts
+++ b/src/commands/moderation/kick.ts
@@ -46,11 +46,7 @@ export default class KickCommand extends BushCommand {
});
}
- private async *genResponses(
- message: Message | CommandInteraction,
- user: GuildMember,
- reason?: string
- ): AsyncIterable<string> {
+ private async *genResponses(message: Message | CommandInteraction, user: GuildMember, reason?: string): AsyncIterable<string> {
let modlogEnry: Modlog;
// Create guild entry so postgres doesn't get mad when I try and add a modlog entry
await Guild.findOrCreate({
@@ -76,18 +72,12 @@ export default class KickCommand extends BushCommand {
return;
}
try {
- await user.send(
- `You were kicked in ${message.guild.name} with reason \`${reason || 'No reason given'}\``
- );
+ await user.send(`You were kicked in ${message.guild.name} with reason \`${reason || 'No reason given'}\``);
} catch (e) {
yield 'Error sending message to user';
}
try {
- await user.kick(
- `Kicked by ${message instanceof Message ? message.author.tag : message.user.tag} with ${
- reason ? `reason ${reason}` : 'no reason'
- }`
- );
+ await user.kick(`Kicked by ${message instanceof Message ? message.author.tag : message.user.tag} with ${reason ? `reason ${reason}` : 'no reason'}`);
} catch {
yield 'Error kicking :/';
await modlogEnry.destroy();
@@ -96,19 +86,13 @@ export default class KickCommand extends BushCommand {
yield `Kicked <@!${user.id}> with reason \`${reason || 'No reason given'}\``;
}
- async exec(
- message: Message,
- { user, reason }: { user: GuildMember; reason?: string }
- ): Promise<void> {
+ async exec(message: Message, { user, reason }: { user: GuildMember; reason?: string }): Promise<void> {
for await (const response of this.genResponses(message, user, reason)) {
await message.util.send(response);
}
}
- async execSlash(
- message: CommandInteraction,
- { user, reason }: { user: GuildMember; reason?: string }
- ): Promise<void> {
+ async execSlash(message: CommandInteraction, { user, reason }: { user: GuildMember; reason?: string }): Promise<void> {
for await (const response of this.genResponses(message, user, reason)) {
await message.reply(response);
}
diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts
index c4eb46a..806c00a 100644
--- a/src/commands/moderation/modlog.ts
+++ b/src/commands/moderation/modlog.ts
@@ -110,9 +110,7 @@ export default class ModlogCommand extends BushCommand {
},
{
name: 'Duration',
- value: `${
- entry.duration ? moment.duration(entry.duration, 'milliseconds').humanize() : 'N/A'
- }`,
+ value: `${entry.duration ? moment.duration(entry.duration, 'milliseconds').humanize() : 'N/A'}`,
inline: true
},
{
diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts
index f03e0ad..0c7d7db 100644
--- a/src/commands/moderation/role.ts
+++ b/src/commands/moderation/role.ts
@@ -7,15 +7,7 @@ import { ApplicationCommandOptionType } from 'discord-api-types';
export default class RoleCommand extends BushCommand {
private roleWhitelist: Record<string, string[]> = {
'Partner': ['*', 'Admin Perms', 'Sr. Moderator', 'Moderator'],
- 'Suggester': [
- '*',
- 'Admin Perms',
- 'Sr. Moderator',
- 'Moderator',
- 'Helper',
- 'Trial Helper',
- 'Contributor'
- ],
+ 'Suggester': ['*', 'Admin Perms', 'Sr. Moderator', 'Moderator', 'Helper', 'Trial Helper', 'Contributor'],
'Level Locked': ['*', 'Admin Perms', 'Sr. Moderator', 'Moderator'],
'No Files': ['*', 'Admin Perms', 'Sr. Moderator', 'Moderator'],
'No Reactions': ['*', 'Admin Perms', 'Sr. Moderator', 'Moderator'],
@@ -81,59 +73,38 @@ export default class RoleCommand extends BushCommand {
});
}
- public async exec(
- message: Message,
- { user, role }: { user: GuildMember; role: Role }
- ): Promise<unknown> {
- if (
- !message.member.permissions.has('MANAGE_ROLES') &&
- !this.client.ownerID.includes(message.author.id)
- ) {
+ public async exec(message: Message, { user, role }: { user: GuildMember; role: Role }): Promise<unknown> {
+ if (!message.member.permissions.has('MANAGE_ROLES') && !this.client.ownerID.includes(message.author.id)) {
const mappedRole = this.client.util.moulberryBushRoleMap.find((m) => m.id === role.id);
if (!mappedRole || !this.roleWhitelist[mappedRole.name]) {
- return message.util.reply(
- `<:error:837123021016924261> <@&${role.id}> is not whitelisted, and you do not have manage roles permission.`,
- {
- allowedMentions: AllowedMentions.none()
- }
- );
+ return message.util.reply(`<:error:837123021016924261> <@&${role.id}> is not whitelisted, and you do not have manage roles permission.`, {
+ allowedMentions: AllowedMentions.none()
+ });
}
const allowedRoles = this.roleWhitelist[mappedRole.name].map((r) => {
return this.client.util.moulberryBushRoleMap.find((m) => m.name === r).id;
});
if (!message.member.roles.cache.some((role) => allowedRoles.includes(role.id))) {
- return message.util.reply(
- `<:error:837123021016924261> <@&${role.id}> is whitelisted, but you do not have any of the roles required to manage it.`,
- {
- allowedMentions: AllowedMentions.none()
- }
- );
+ return message.util.reply(`<:error:837123021016924261> <@&${role.id}> is whitelisted, but you do not have any of the roles required to manage it.`, {
+ allowedMentions: AllowedMentions.none()
+ });
}
}
if (!this.client.ownerID.includes(message.author.id)) {
if (role.comparePositionTo(message.member.roles.highest) >= 0) {
- return message.util.reply(
- `<:error:837123021016924261> <@&${role.id}> is higher or equal to your highest role.`,
- {
- allowedMentions: AllowedMentions.none()
- }
- );
+ return message.util.reply(`<:error:837123021016924261> <@&${role.id}> is higher or equal to your highest role.`, {
+ allowedMentions: AllowedMentions.none()
+ });
}
if (role.comparePositionTo(message.guild.me.roles.highest) >= 0) {
- return message.util.reply(
- `<:error:837123021016924261> <@&${role.id}> is higher or equal to my highest role.`,
- {
- allowedMentions: AllowedMentions.none()
- }
- );
+ return message.util.reply(`<:error:837123021016924261> <@&${role.id}> is higher or equal to my highest role.`, {
+ allowedMentions: AllowedMentions.none()
+ });
}
if (role.managed) {
- await message.util.reply(
- `<:error:837123021016924261> <@&${role.id}> is managed by an integration and cannot be managed.`,
- {
- allowedMentions: AllowedMentions.none()
- }
- );
+ await message.util.reply(`<:error:837123021016924261> <@&${role.id}> is managed by an integration and cannot be managed.`, {
+ allowedMentions: AllowedMentions.none()
+ });
}
}
// No checks if the user has MANAGE_ROLES
@@ -141,28 +112,16 @@ export default class RoleCommand extends BushCommand {
try {
await user.roles.remove(role.id);
} catch {
- return message.util.reply(
- `<:error:837123021016924261> Could not remove <@&${role.id}> from <@${user.id}>.`,
- { allowedMentions: AllowedMentions.none() }
- );
+ return message.util.reply(`<:error:837123021016924261> Could not remove <@&${role.id}> from <@${user.id}>.`, { allowedMentions: AllowedMentions.none() });
}
- return message.util.reply(
- `<:checkmark:837109864101707807> Successfully removed <@&${role.id}> from <@${user.id}>!`,
- { allowedMentions: AllowedMentions.none() }
- );
+ return message.util.reply(`<:checkmark:837109864101707807> Successfully removed <@&${role.id}> from <@${user.id}>!`, { allowedMentions: AllowedMentions.none() });
} else {
try {
await user.roles.add(role.id);
} catch {
- return message.util.reply(
- `<:error:837123021016924261> Could not add <@&${role.id}> to <@${user.id}>.`,
- { allowedMentions: AllowedMentions.none() }
- );
+ return message.util.reply(`<:error:837123021016924261> Could not add <@&${role.id}> to <@${user.id}>.`, { allowedMentions: AllowedMentions.none() });
}
- return message.util.reply(
- `<:checkmark:837109864101707807> Successfully added <@&${role.id}> to <@${user.id}>!`,
- { allowedMentions: AllowedMentions.none() }
- );
+ return message.util.reply(`<:checkmark:837109864101707807> Successfully added <@&${role.id}> to <@${user.id}>!`, { allowedMentions: AllowedMentions.none() });
}
}
}
diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts
index 5651830..3410d81 100644
--- a/src/commands/moderation/warn.ts
+++ b/src/commands/moderation/warn.ts
@@ -25,10 +25,7 @@ export default class WarnCommand extends BushCommand {
}
});
}
- public async exec(
- message: Message,
- { member, reason }: { member: GuildMember; reason: string }
- ): Promise<void> {
+ public async exec(message: Message, { member, reason }: { member: GuildMember; reason: string }): Promise<void> {
// Create guild entry so postgres doesn't get mad when I try and add a modlog entry
await Guild.findOrCreate({
where: {
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], {
diff --git a/src/commands/server-config/prefix.ts b/src/commands/server-config/prefix.ts
index f02e693..c60f8fb 100644
--- a/src/commands/server-config/prefix.ts
+++ b/src/commands/server-config/prefix.ts
@@ -57,10 +57,7 @@ export default class PrefixCommand extends BushCommand {
}
}
- async execSlash(
- message: CommandInteraction,
- { prefix }: { prefix?: SlashCommandOption<string> }
- ): Promise<void> {
+ async execSlash(message: CommandInteraction, { prefix }: { prefix?: SlashCommandOption<string> }): Promise<void> {
await this.changePrefix(message.guild, prefix?.value);
if (prefix) {
await message.reply(`Sucessfully set prefix to \`${prefix.value}\``);