bump libs
migrate to typescript 6 remove ytdl feature
This commit is contained in:
@@ -18,14 +18,14 @@ export class GeminiGenerateImage extends Command {
|
||||
async execute(msg: Message, match?: RegExpExecArray): Promise<void> {
|
||||
console.log("match", match);
|
||||
|
||||
const prompt = match?.[3];
|
||||
const prompt = match?.[3] || "";
|
||||
return this.executeGenImage(msg, prompt);
|
||||
}
|
||||
|
||||
async executeGenImage(msg: Message, text: string): Promise<void> {
|
||||
if (!text || text.trim().length === 0) return;
|
||||
if (!text || !text.trim().length) return;
|
||||
|
||||
let waitMessage: Message;
|
||||
let waitMessage: Message | null = null;
|
||||
|
||||
try {
|
||||
waitMessage = await replyToMessage({
|
||||
@@ -47,14 +47,16 @@ export class GeminiGenerateImage extends Command {
|
||||
console.log(`Output ${index + 1}: ${output}`);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
logError(e);
|
||||
|
||||
await replyToMessage({
|
||||
message: waitMessage,
|
||||
text: `Произошла ошибка!\n${e.toString()}`,
|
||||
link_preview_options: {is_disabled: true}
|
||||
}).catch(logError);
|
||||
if (waitMessage) {
|
||||
await replyToMessage({
|
||||
message: waitMessage,
|
||||
text: `Произошла ошибка!\n${e.toString()}`,
|
||||
link_preview_options: {is_disabled: true}
|
||||
}).catch(logError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user