diff --git a/src/api/routes/interactions/#interaction_id/#interaction_token/callback.ts b/src/api/routes/interactions/#interaction_id/#interaction_token/callback.ts index 5a8bec014..d9af73636 100644 --- a/src/api/routes/interactions/#interaction_id/#interaction_token/callback.ts +++ b/src/api/routes/interactions/#interaction_id/#interaction_token/callback.ts @@ -128,7 +128,7 @@ router.post("/", route({}), async (req: Request, res: Response) => { return; case InteractionCallbackType.UPDATE_MESSAGE: { - if (!interaction.mesageId) throw new HTTPError("no. That was not a message"); + if (!interaction.messageId) throw new HTTPError("no. That was not a message"); const message = await Message.findOneOrFail({ relations: { author: true, @@ -147,7 +147,7 @@ router.post("/", route({}), async (req: Request, res: Response) => { channel: true, }, where: { - id: interaction.mesageId, + id: interaction.messageId, }, }); if (body.data.content && body.data.content.length > Config.get().limits.message.maxCharacters) { diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index a448cf4a2..c59e403a7 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -347,6 +347,7 @@ export async function handleMessage(opts: MessageOptions): Promise { where: { id: opts.author_id }, }); const rights = await getRights(opts.author_id); + message.author.clean_data(); rights.hasThrow("SEND_MESSAGES"); }