From 2f059ceaff5fb3fc068311aae8625def7bb18077 Mon Sep 17 00:00:00 2001 From: Vargoshi Date: Sun, 15 Oct 2023 21:47:08 +0200 Subject: [PATCH] fix errors --- bot/img2imgCommand.ts | 2 +- bot/txt2imgCommand.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/img2imgCommand.ts b/bot/img2imgCommand.ts index ed8b635..edca6d1 100644 --- a/bot/img2imgCommand.ts +++ b/bot/img2imgCommand.ts @@ -28,7 +28,7 @@ async function img2img( includeRepliedTo: boolean, state: QuestionState = {}, ): Promise { - if (!ctx.from) { + if (!ctx.from || !ctx.message) { return; } diff --git a/bot/txt2imgCommand.ts b/bot/txt2imgCommand.ts index 851ed74..5a2be61 100644 --- a/bot/txt2imgCommand.ts +++ b/bot/txt2imgCommand.ts @@ -20,7 +20,7 @@ export async function txt2imgCommand(ctx: CommandContext) { } async function txt2img(ctx: ErisContext, match: string, includeRepliedTo: boolean): Promise { - if (!ctx.from) { + if (!ctx.from || !ctx.message) { return; }