Merge pull request #448 from VermiumSifell/dev

Fixed more code smells
This commit is contained in:
Axel Olausson Holtenäs 2022-10-21 20:33:08 +02:00 committed by GitHub
commit 01dc7a06e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 1 deletions

View file

@ -3,6 +3,7 @@ import logger from "../../middlewares/logger";
export const metadata = { guildOnly: false, ephemeral: false }; export const metadata = { guildOnly: false, ephemeral: false };
export const execute = async (interaction: ButtonInteraction) => { // Execute the function
export const execute = (interaction: ButtonInteraction) => {
logger.debug(interaction.customId, "primary button clicked!"); logger.debug(interaction.customId, "primary button clicked!");
}; };

View file

@ -6,6 +6,7 @@ export const options: IEventOptions = {
type: "on", type: "on",
}; };
// Execute the function
export const execute = async (message: Message) => { export const execute = async (message: Message) => {
await modules.credits.execute(message); await modules.credits.execute(message);
await modules.points.execute(message); await modules.points.execute(message);

View file

@ -7,6 +7,7 @@ export const options: IEventOptions = {
type: "on", type: "on",
}; };
// Execute the function
export const execute = async (message: Message) => { export const execute = async (message: Message) => {
await audits.execute(message); await audits.execute(message);
await counter(message); await counter(message);

View file

@ -12,6 +12,7 @@ export const options: IEventOptions = {
type: "on", type: "on",
}; };
// Execute the function
export const execute = async (oldMessage: Message, newMessage: Message) => { export const execute = async (oldMessage: Message, newMessage: Message) => {
const { author, guild } = newMessage; const { author, guild } = newMessage;

View file

@ -4,6 +4,7 @@ import checkDirectory from "../../helpers/checkDirectory";
import { IJob } from "../../interfaces/Job"; import { IJob } from "../../interfaces/Job";
import logger from "../../middlewares/logger"; import logger from "../../middlewares/logger";
// Start all jobs that are in the schedules directory
export const start = async (client: Client) => { export const start = async (client: Client) => {
logger.info("⏰ Started job management"); logger.info("⏰ Started job management");

View file

@ -3,6 +3,7 @@ import { IEncryptionData } from "../../interfaces/EncryptionData";
const iv = crypto.randomBytes(16); const iv = crypto.randomBytes(16);
// Encrypts a string
const encrypt = (text: crypto.BinaryLike): IEncryptionData => { const encrypt = (text: crypto.BinaryLike): IEncryptionData => {
const cipher = crypto.createCipheriv( const cipher = crypto.createCipheriv(
process.env.ENCRYPTION_ALGORITHM, process.env.ENCRYPTION_ALGORITHM,
@ -17,6 +18,7 @@ const encrypt = (text: crypto.BinaryLike): IEncryptionData => {
}; };
}; };
// Decrypts a string
const decrypt = (hash: IEncryptionData) => { const decrypt = (hash: IEncryptionData) => {
const decipher = crypto.createDecipheriv( const decipher = crypto.createDecipheriv(
process.env.ENCRYPTION_ALGORITHM, process.env.ENCRYPTION_ALGORITHM,