aboutsummaryrefslogtreecommitdiff
path: root/src/commands/info/pronouns.ts
diff options
context:
space:
mode:
authorTymanWasTaken <32660892+tymanwastaken@users.noreply.github.com>2021-05-28 21:51:02 -0600
committerTymanWasTaken <32660892+tymanwastaken@users.noreply.github.com>2021-05-28 21:51:02 -0600
commit1e9e334097702c68d871365fc016aa096d03c491 (patch)
tree65b22d1d529cda850e5c30e9fe19a2504fca2645 /src/commands/info/pronouns.ts
parent53d8d5e551e9a239fd4c48c7dca4e1f6fb8d81e9 (diff)
downloadtanzanite-1e9e334097702c68d871365fc016aa096d03c491.tar.gz
tanzanite-1e9e334097702c68d871365fc016aa096d03c491.tar.bz2
tanzanite-1e9e334097702c68d871365fc016aa096d03c491.zip
Remove references - caused some issues, comment out some image gen code
Diffstat (limited to 'src/commands/info/pronouns.ts')
-rw-r--r--src/commands/info/pronouns.ts37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts
index 07d210f..97cca34 100644
--- a/src/commands/info/pronouns.ts
+++ b/src/commands/info/pronouns.ts
@@ -59,9 +59,17 @@ export default class PronounsCommand extends BotCommand {
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({
@@ -71,7 +79,7 @@ export default class PronounsCommand extends BotCommand {
text: 'Data provided by https://pronoundb.org/'
}
})
- )
+ );
} else {
message.reply({
embeds: [
@@ -83,24 +91,31 @@ export default class PronounsCommand extends BotCommand {
}
})
]
- })
+ });
}
} 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;
}
}
async exec(message: Message, { user }: { user?: User }): Promise<void> {
const u = user || message.author;
- await this.sendResponse(message, u, u.id === message.author.id)
+ await this.sendResponse(message, u, u.id === message.author.id);
}
- 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)
+ 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);
}
-} \ No newline at end of file
+}