aboutsummaryrefslogtreecommitdiff
path: root/src/commands/info
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/info')
-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
4 files changed, 16 insertions, 55 deletions
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);
}