aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/extensions')
-rw-r--r--src/lib/extensions/BushClient.ts8
-rw-r--r--src/lib/extensions/Util.ts27
2 files changed, 9 insertions, 26 deletions
diff --git a/src/lib/extensions/BushClient.ts b/src/lib/extensions/BushClient.ts
index 8a8ae91..99d0dd3 100644
--- a/src/lib/extensions/BushClient.ts
+++ b/src/lib/extensions/BushClient.ts
@@ -122,14 +122,10 @@ export class BushClient extends AkairoClient {
for (const loader of Object.keys(loaders)) {
try {
loaders[loader].loadAll();
- this.logger.log(
- chalk.green('Successfully loaded ' + chalk.cyan(loader) + '.')
- );
+ this.logger.log(chalk.green('Successfully loaded ' + chalk.cyan(loader) + '.'));
} catch (e) {
console.error(
- chalk.red(
- 'Unable to load loader ' + chalk.cyan(loader) + ' with error ' + e
- )
+ chalk.red('Unable to load loader ' + chalk.cyan(loader) + ' with error ' + e)
);
}
}
diff --git a/src/lib/extensions/Util.ts b/src/lib/extensions/Util.ts
index 7c1d4b2..7bedfc1 100644
--- a/src/lib/extensions/Util.ts
+++ b/src/lib/extensions/Util.ts
@@ -125,9 +125,7 @@ export class Util extends ClientUtil {
public async haste(content: string): Promise<string> {
for (const url of this.hasteURLs) {
try {
- const res: hastebinRes = await got
- .post(`${url}/documents`, { body: content })
- .json();
+ const res: hastebinRes = await got.post(`${url}/documents`, { body: content }).json();
return `${url}/${res.key}`;
} catch (e) {
// pass
@@ -220,10 +218,7 @@ export class Util extends ClientUtil {
/**
* A simple utility to create and embed with the needed style for the bot
*/
- public createEmbed(
- color?: string,
- author?: User | GuildMember
- ): MessageEmbed {
+ public createEmbed(color?: string, author?: User | GuildMember): MessageEmbed {
if (author instanceof GuildMember) {
author = author.user; // Convert to User if GuildMember
}
@@ -255,15 +250,12 @@ export class Util extends ClientUtil {
: await fetchedGuild.commands.fetch();
for (const [, registeredCommand] of registered) {
if (
- !this.client.commandHandler.modules.find(
- (cmd) => cmd.id == registeredCommand.name
- )?.execSlash ||
+ !this.client.commandHandler.modules.find((cmd) => cmd.id == registeredCommand.name)
+ ?.execSlash ||
force
) {
guild === undefined
- ? await this.client.application.commands.delete(
- registeredCommand.id
- )
+ ? await this.client.application.commands.delete(registeredCommand.id)
: await fetchedGuild.commands.delete(registeredCommand.id);
this.client.logger.verbose(
chalk`{red Deleted slash command ${registeredCommand.name}${
@@ -286,10 +278,7 @@ export class Util extends ClientUtil {
if (found?.id && !force) {
if (slashdata.description !== found.description) {
guild === undefined
- ? await this.client.application.commands.edit(
- found.id,
- slashdata
- )
+ ? await this.client.application.commands.edit(found.id, slashdata)
: fetchedGuild.commands.edit(found.id, slashdata);
this.client.logger.verbose(
chalk`{yellow Edited slash command ${BushCommand.id}${
@@ -312,9 +301,7 @@ export class Util extends ClientUtil {
return this.client.logger.log(
chalk.green(
- `Slash commands registered${
- guild !== undefined ? ` in guild ${fetchedGuild.name}` : ''
- }`
+ `Slash commands registered${guild !== undefined ? ` in guild ${fetchedGuild.name}` : ''}`
)
);
} catch (e) {