deps
This commit is contained in:
parent
eb3950b79c
commit
58e8e5c6ea
|
@ -62,7 +62,7 @@ bot.api.setMyCommands([
|
|||
bot.command("start", (ctx) => ctx.reply("Hello! Use the /txt2img command to generate an image"));
|
||||
|
||||
bot.command("txt2img", txt2imgCommand);
|
||||
bot.use(txt2imgQuestion.middleware() as any);
|
||||
bot.use(txt2imgQuestion.middleware());
|
||||
|
||||
bot.command("queue", queueCommand);
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@ import { jobStore } from "../db/jobStore.ts";
|
|||
import { parsePngInfo } from "../sd.ts";
|
||||
import { Context, logger } from "./mod.ts";
|
||||
|
||||
export const txt2imgQuestion = new GrammyStatelessQ.StatelessQuestion(
|
||||
export const txt2imgQuestion = new GrammyStatelessQ.StatelessQuestion<Context>(
|
||||
"txt2img",
|
||||
async (ctx) => {
|
||||
if (!ctx.message.text) return;
|
||||
await txt2img(ctx as any, ctx.message.text, false);
|
||||
await txt2img(ctx, ctx.message.text, false);
|
||||
},
|
||||
);
|
||||
|
||||
|
@ -48,6 +48,7 @@ async function txt2img(ctx: Context, match: string, includeRepliedTo: boolean):
|
|||
const repliedToMsg = ctx.message.reply_to_message;
|
||||
const repliedToText = repliedToMsg?.text || repliedToMsg?.caption;
|
||||
if (includeRepliedTo && repliedToText) {
|
||||
// TODO: remove bot command from replied to text
|
||||
const originalParams = parsePngInfo(repliedToText);
|
||||
params = {
|
||||
...originalParams,
|
||||
|
|
2
deps.ts
2
deps.ts
|
@ -11,7 +11,7 @@ export * as GrammyTypes from "https://deno.land/x/grammy_types@v3.2.0/mod.ts";
|
|||
export * as GrammyAutoQuote from "https://deno.land/x/grammy_autoquote@v1.1.2/mod.ts";
|
||||
export * as GrammyParseMode from "https://deno.land/x/grammy_parse_mode@1.7.1/mod.ts";
|
||||
export * as GrammyKvStorage from "https://deno.land/x/grammy_storages@v2.3.1/denokv/src/mod.ts";
|
||||
export * as GrammyStatelessQ from "npm:@grammyjs/stateless-question";
|
||||
export * as GrammyStatelessQ from "https://deno.land/x/grammy_stateless_question_alpha@v3.0.3/mod.ts";
|
||||
export * as FileType from "npm:file-type@18.5.0";
|
||||
// @deno-types="./types/png-chunks-extract.d.ts"
|
||||
export * as PngChunksExtract from "npm:png-chunks-extract@1.0.0";
|
||||
|
|
Loading…
Reference in New Issue