aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/extensions/BushClient.ts8
-rw-r--r--src/lib/extensions/Util.ts27
-rw-r--r--src/lib/models/Ban.ts5
-rw-r--r--src/lib/models/Modlog.ts9
-rw-r--r--src/lib/utils/Logger.ts4
5 files changed, 12 insertions, 41 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) {
diff --git a/src/lib/models/Ban.ts b/src/lib/models/Ban.ts
index 3ce9c06..75e38ab 100644
--- a/src/lib/models/Ban.ts
+++ b/src/lib/models/Ban.ts
@@ -20,10 +20,7 @@ export interface BanModelCreationAttributes {
modlog: string;
}
-export class Ban
- extends BaseModel<BanModel, BanModelCreationAttributes>
- implements BanModel
-{
+export class Ban extends BaseModel<BanModel, BanModelCreationAttributes> implements BanModel {
/**
* The ID of this ban (no real use just for a primary key)
*/
diff --git a/src/lib/models/Modlog.ts b/src/lib/models/Modlog.ts
index 7efeeed..52a13b2 100644
--- a/src/lib/models/Modlog.ts
+++ b/src/lib/models/Modlog.ts
@@ -54,14 +54,7 @@ export class Modlog
defaultValue: uuidv4
},
type: {
- type: new DataTypes.ENUM(
- 'BAN',
- 'TEMPBAN',
- 'MUTE',
- 'TEMPMUTE',
- 'KICK',
- 'WARN'
- ),
+ type: new DataTypes.ENUM('BAN', 'TEMPBAN', 'MUTE', 'TEMPMUTE', 'KICK', 'WARN'),
allowNull: false
},
user: {
diff --git a/src/lib/utils/Logger.ts b/src/lib/utils/Logger.ts
index 604b45e..b0f7da5 100644
--- a/src/lib/utils/Logger.ts
+++ b/src/lib/utils/Logger.ts
@@ -15,9 +15,7 @@ export class Logger {
);
}
public getChannel(channel: 'log' | 'error' | 'dm'): Promise<TextChannel> {
- return this.client.channels.fetch(
- this.client.config.channels[channel]
- ) as Promise<TextChannel>;
+ return this.client.channels.fetch(this.client.config.channels[channel]) as Promise<TextChannel>;
}
public async log(message: string, sendChannel = false): Promise<void> {
console.log(chalk`{bgCyan LOG} ` + message);