From 39189ff25b7ebb041ad91f36908e6dc7f78b7e53 Mon Sep 17 00:00:00 2001 From: Benedikt Magnus <magnus@magnuscraft.de> Date: Tue, 2 Nov 2021 22:41:21 +0100 Subject: [PATCH] TODOs and formatting --- scripts/wichtelbot/endpoint/definitions/message.ts | 2 +- .../endpoint/implementations/discord/discordClient.ts | 2 +- .../endpoint/implementations/discord/discordInteraction.ts | 2 +- scripts/wichtelbot/message/handlingDefinition.ts | 1 + scripts/wichtelbot/message/messageHandler.ts | 3 +++ scripts/wichtelbot/message/modules/informationModule.ts | 4 +++- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/wichtelbot/endpoint/definitions/message.ts b/scripts/wichtelbot/endpoint/definitions/message.ts index 7c6b847..a837e77 100644 --- a/scripts/wichtelbot/endpoint/definitions/message.ts +++ b/scripts/wichtelbot/endpoint/definitions/message.ts @@ -39,7 +39,7 @@ export default interface Message */ channel: Channel; /** - * The client that is instantiated the message. + * The client that has instantiated the message. */ client: Client; /** diff --git a/scripts/wichtelbot/endpoint/implementations/discord/discordClient.ts b/scripts/wichtelbot/endpoint/implementations/discord/discordClient.ts index 3325397..f24b832 100644 --- a/scripts/wichtelbot/endpoint/implementations/discord/discordClient.ts +++ b/scripts/wichtelbot/endpoint/implementations/discord/discordClient.ts @@ -17,7 +17,7 @@ export class DiscordClient implements Client public getChannel (id: string): DiscordChannel { - const channel = this.client.channels.cache.get(id); + const channel = this.client.channels.cache.get(id); // TODO: Shouldn't this be fetched, too? if (channel === undefined) { diff --git a/scripts/wichtelbot/endpoint/implementations/discord/discordInteraction.ts b/scripts/wichtelbot/endpoint/implementations/discord/discordInteraction.ts index 2a197d1..98b2c6b 100644 --- a/scripts/wichtelbot/endpoint/implementations/discord/discordInteraction.ts +++ b/scripts/wichtelbot/endpoint/implementations/discord/discordInteraction.ts @@ -1,10 +1,10 @@ import * as Discord from 'discord.js'; import { Component, Message } from '../../definitions'; +import { DiscordUtils, SendMessage } from './discordUtils'; import Config from '../../../../utility/config'; import { DiscordChannel } from './discordChannel'; import { DiscordClient } from './discordClient'; import { DiscordUser } from './discordUser'; -import { DiscordUtils, SendMessage } from './discordUtils'; import { MessageWithParser } from '../../base/messageWithParser'; import Utils from '../../../../utility/utils'; diff --git a/scripts/wichtelbot/message/handlingDefinition.ts b/scripts/wichtelbot/message/handlingDefinition.ts index 2771211..b5edf1f 100644 --- a/scripts/wichtelbot/message/handlingDefinition.ts +++ b/scripts/wichtelbot/message/handlingDefinition.ts @@ -403,6 +403,7 @@ export default class HandlingDefinition handlerFunction: async (message: Message): Promise<void> => this.generalModule.firstContact(message) } ]; + public moderatorCommands: CommandDefinition[] = [ ]; diff --git a/scripts/wichtelbot/message/messageHandler.ts b/scripts/wichtelbot/message/messageHandler.ts index 868abb4..f8a6057 100644 --- a/scripts/wichtelbot/message/messageHandler.ts +++ b/scripts/wichtelbot/message/messageHandler.ts @@ -22,6 +22,9 @@ enum CommandCallResult // TODO: Documentation export default class MessageHandler { + // TODO: Make everything private instead of protected (the same for every class where protected is not needed). + // TODO: Initialise all fields in the constructor only, not in the declaration (the same for every other class). + protected database: Database; protected generalModule: GeneralModule; diff --git a/scripts/wichtelbot/message/modules/informationModule.ts b/scripts/wichtelbot/message/modules/informationModule.ts index 3149345..f801c03 100644 --- a/scripts/wichtelbot/message/modules/informationModule.ts +++ b/scripts/wichtelbot/message/modules/informationModule.ts @@ -51,7 +51,7 @@ export default class InformationModule { // NOTE: Boolean values are only send if they are true. False is the default value. // This is needed to prevent sending "current values" the first time a contact registered. - // We could allow null for boolean values instead. + // TODO: We could allow null for boolean values instead. if (booleanValue) { await this.sendCurrentInformationValue(message, member, Localisation.translateBoolean(booleanValue)); @@ -310,5 +310,7 @@ export default class InformationModule const answer = text.process(member, parameters); await message.reply(answer); + + // TODO: Should we send an overview (like the Steckbrief) to the user? } } -- GitLab