Skip to content

Commit 23e8f32

Browse files
author
Tinaël Devresse
committed
style: lint after rebase
1 parent 9aa83bc commit 23e8f32

File tree

11 files changed

+63
-32
lines changed

11 files changed

+63
-32
lines changed

src/config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ const defaultConfig: Configuration = {
2929
tutor: { roleid: "", emote: "" },
3030
announce: { roleid: "", emote: "", channelid: "" },
3131
communicationServiceOptions: {
32-
auth: { user: '', pass: '' },
33-
from: '',
32+
auth: { user: "", pass: "" },
33+
from: "",
3434
port: 587,
35-
host: ''
36-
}
35+
host: "",
36+
},
3737
};
3838

3939
export async function readConfig(): Promise<Configuration> {
@@ -55,7 +55,7 @@ export async function readConfig(): Promise<Configuration> {
5555
};
5656
config.communicationServiceOptions.auth = {
5757
user: process.env.SMTP_USER,
58-
pass: process.env.SMTP_PASS
58+
pass: process.env.SMTP_PASS,
5959
};
6060

6161
return config;

src/datadrop.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,16 @@ import {
3535
VerificationManagerEvents,
3636
} from "@hunteroi/discord-verification";
3737

38-
import { PostgresDatabaseService, SMTPService } from './services/index.js';
39-
import { getErrorMessage, readFilesFrom } from './helpers.js';
40-
import type { Command, Event, Configuration, IDatabaseService, User } from './models/index.js';
41-
import { readConfig } from './config.js';
38+
import { readConfig } from "./config.js";
39+
import { getErrorMessage, readFilesFrom } from "./helpers.js";
40+
import type {
41+
Command,
42+
Configuration,
43+
Event,
44+
IDatabaseService,
45+
User,
46+
} from "./models/index.js";
47+
import { PostgresDatabaseService, SMTPService } from "./services/index.js";
4248

4349
export class DatadropClient extends Client {
4450
#config: Configuration;
@@ -70,7 +76,9 @@ export class DatadropClient extends Client {
7076
this.tempChannelsManager = new TempChannelsManager(this);
7177

7278
this.database = new PostgresDatabaseService(this.logger);
73-
const communicationService = new SMTPService(config.communicationServiceOptions);
79+
const communicationService = new SMTPService(
80+
config.communicationServiceOptions,
81+
);
7482
this.verificationManager = new VerificationManager(
7583
this,
7684
this.database,

src/events/error.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import type { DatadropClient } from '../datadrop.js';
1+
import type { DatadropClient } from "../datadrop.js";
22

33
export default async function error(client: DatadropClient, error: Error) {
4-
client.logger.error(`${error.name}: ${error.message}\n${error.cause}\n${error.stack}`);
4+
client.logger.error(
5+
`${error.name}: ${error.message}\n${error.cause}\n${error.stack}`,
6+
);
57
}

src/events/guildMemberAdd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from "discord.js";
99

1010
import type { DatadropClient } from "../datadrop.js";
11-
import type { Event, AnnounceConfiguration } from "../models/index.js";
11+
import type { AnnounceConfiguration, Event } from "../models/index.js";
1212

1313
export default {
1414
name: Events.GuildMemberAdd,

src/events/interactionCreate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ async function showVerificationButton(
220220
.setCustomId(`lacb${interaction.user.id}`)
221221
.setDisabled(
222222
content.includes(client.errorMessage) ||
223-
content.includes(client.activeAccountMessage),
223+
content.includes(client.activeAccountMessage),
224224
);
225225
const buttonComponent = new ActionRowBuilder<ButtonBuilder>().addComponents(
226226
linkAccountButton,

src/events/ready.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ButtonStyle, Events, Role, bold, roleMention } from "discord.js";
33
import type { RoleToEmojiData } from "@hunteroi/discord-selfrole";
44

55
import type { DatadropClient } from "../datadrop.js";
6-
import type { Event, Configuration } from "../models/index.js";
6+
import type { Configuration, Event } from "../models/index.js";
77

88
export default {
99
name: Events.ClientReady,

src/models/Configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Snowflake } from "discord.js";
22

3-
import type { SMTPServiceOptions } from '../services/SMTPService.js';
3+
import type { SMTPServiceOptions } from "../services/SMTPService.js";
44

55
export interface SpecialRoleConfiguration {
66
roleid: Snowflake;

src/models/index.ts

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1-
import { Command } from './Command.js';
2-
import { SpecialRoleConfiguration, GroupConfiguration, YearConfiguration, AnnounceConfiguration, Configuration } from './Configuration.js';
3-
import { Event } from './Event.js';
4-
import { IDatabaseService } from './IDatabaseService.js';
5-
import { User } from './User.js';
1+
import { Command } from "./Command.js";
2+
import {
3+
AnnounceConfiguration,
4+
Configuration,
5+
GroupConfiguration,
6+
SpecialRoleConfiguration,
7+
YearConfiguration,
8+
} from "./Configuration.js";
9+
import { Event } from "./Event.js";
10+
import { IDatabaseService } from "./IDatabaseService.js";
11+
import { User } from "./User.js";
612

7-
export { Command, SpecialRoleConfiguration, GroupConfiguration, YearConfiguration, AnnounceConfiguration, Configuration, Event, IDatabaseService, User };
13+
export {
14+
Command,
15+
SpecialRoleConfiguration,
16+
GroupConfiguration,
17+
YearConfiguration,
18+
AnnounceConfiguration,
19+
Configuration,
20+
Event,
21+
IDatabaseService,
22+
User,
23+
};

src/services/PostgresDatabaseService.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88

99
import type { ConsoleLogger } from "@hunteroi/advanced-logger";
1010

11-
import type { User, IDatabaseService } from '../models/index.js';
11+
import type { IDatabaseService, User } from "../models/index.js";
1212

1313
export default class PostgresDatabaseService implements IDatabaseService {
1414
readonly #logger: ConsoleLogger;
@@ -104,7 +104,7 @@ export default class PostgresDatabaseService implements IDatabaseService {
104104
*/
105105
public async readBy(
106106
argument: // biome-ignore lint/suspicious/noExplicitAny: DB values can be of any type
107-
Map<string, any> | ((user: User, index: string | number) => boolean),
107+
Map<string, any> | ((user: User, index: string | number) => boolean),
108108
): Promise<User | undefined | null> {
109109
if (!(argument instanceof Map))
110110
throw new Error("Method not implemented.");
@@ -215,9 +215,14 @@ export default class PostgresDatabaseService implements IDatabaseService {
215215
"SELECT * FROM Migrations WHERE name = $1",
216216
[name],
217217
);
218-
this.#logger.verbose(`Running migration "${name}" with pre-query returning ${JSON.stringify(result)}`);
218+
this.#logger.verbose(
219+
`Running migration "${name}" with pre-query returning ${JSON.stringify(result)}`,
220+
);
219221
if (result && result.rows.length === 0) {
220-
await this.#database.query('INSERT INTO Migrations (name) VALUES($1);', [name]);
222+
await this.#database.query(
223+
"INSERT INTO Migrations (name) VALUES($1);",
224+
[name],
225+
);
221226
await callback();
222227
}
223228
}

src/services/SMTPService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { createTransport } from 'nodemailer';
2-
import type SMTPTransport from 'nodemailer/lib/smtp-transport';
1+
import { createTransport } from "nodemailer";
2+
import type SMTPTransport from "nodemailer/lib/smtp-transport";
33

4-
import type { ISenderAPI, SenderAPIData } from '@hunteroi/discord-verification';
4+
import type { ISenderAPI, SenderAPIData } from "@hunteroi/discord-verification";
55

66
export type SMTPServiceOptions = SMTPTransport.Options;
77

@@ -20,7 +20,7 @@ export default class SMTPService implements ISenderAPI {
2020
to: data.to,
2121
subject: "Code d'Authentification Discord",
2222
text: `Hello ${name}! Ton code est ${code}. A plus tard o/`,
23-
html: `<p>Hello ${name}!</p><p>Ton code est ${code}.</p><p>A plus tard o/</p>`
23+
html: `<p>Hello ${name}!</p><p>Ton code est ${code}.</p><p>A plus tard o/</p>`,
2424
});
2525
}
2626
}

0 commit comments

Comments
 (0)