From 680eeea7a15e279a544940960aadb8a431e7e76c Mon Sep 17 00:00:00 2001 From: Ale Date: Tue, 5 Sep 2023 20:07:46 +0200 Subject: [PATCH] feat: adding color changing --- src/commands/colorAlterChange.ts | 1 + src/commands/colorAlterChange.ts~ | 1 + src/index.ts | 5 +++-- src/utils/commandHandler.ts | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 src/commands/colorAlterChange.ts create mode 100644 src/commands/colorAlterChange.ts~ diff --git a/src/commands/colorAlterChange.ts b/src/commands/colorAlterChange.ts new file mode 100644 index 0000000..85b0824 --- /dev/null +++ b/src/commands/colorAlterChange.ts @@ -0,0 +1 @@ +export async function colorAlterChange(userId: string, args: string[]){} diff --git a/src/commands/colorAlterChange.ts~ b/src/commands/colorAlterChange.ts~ new file mode 100644 index 0000000..42fe4ad --- /dev/null +++ b/src/commands/colorAlterChange.ts~ @@ -0,0 +1 @@ +export function colorAlterChange(userId: string, args: string[]){} diff --git a/src/index.ts b/src/index.ts index 6e4e509..dac85a9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,10 +13,11 @@ client.on("ready", async () => { client.on("messageCreate", async (message: Message) => { try{if (!message.author) {await client.users.fetch(message.authorId)} } catch(e){console.log(e)} - + + if (message === undefined) {return} if (message.author?.bot) {} else { - if (message?.content.startsWith(config.prefix)) { + if (message.content.startsWith(config.prefix)) { commandHandler(message, config.prefix); } else { diff --git a/src/utils/commandHandler.ts b/src/utils/commandHandler.ts index d2b414a..b04b6e8 100644 --- a/src/utils/commandHandler.ts +++ b/src/utils/commandHandler.ts @@ -4,6 +4,7 @@ import { listAlters } from "../commands/listAlters" import { createAlter } from "../commands/createAlter" import { deleteAlter } from "../commands/deleteAlter" import { avatarAlterChange } from "../commands/avatarAlterChange" +import { colorAlterChange } from "../commands/colorAlterChange" import { split } from "shlex" export async function commandHandler(message : Message, prefix : String) { @@ -34,6 +35,7 @@ export async function commandHandler(message : Message, prefix : String) { break } case "color" : { + await message.reply(await colorAlterChange(message.author.id, args)); break } }