This commit is contained in:
NAME
2026-05-24 01:40:34 +00:00
parent 9e8c7874df
commit 064c58ce19
+14 -6
View File
@@ -113,6 +113,7 @@ export class TelegramUpdates {
async onWizardCommand(@Ctx() ctx: Scenes.SceneContext): Promise<void> {
await ctx.scene.enter(WIZARD_COMMENT_SCENE_ID);
}
@Command('chatid')
async onGetChatId(ctx: Context) {
// @ts-ignore
@@ -127,12 +128,16 @@ export class TelegramUpdates {
await ctx.reply(`vui lòng đưa topic, ví dụ: /${command} LinkX`);
return;
}
await this.sharedAutoComment(ctx, payload);
await this.sharedAutoComment(ctx, payload, 'realflashkaze');
}
@Action('action_auto_comment')
@Action(/action_auto_comment_(.+)/)
async onDownloadAction(@Ctx() ctx: Context) {
await ctx.answerCbQuery(); // Tắt trạng thái loading trên nút bấm
const callbackData = (ctx.callbackQuery as any).data;
const accountX = callbackData.split('_')[1];
// Ép kiểu để ép TypeScript nhận diện đúng đối tượng tin nhắn chữ
// @ts-ignore
const message = ctx.callbackQuery.message as any;
@@ -142,10 +147,10 @@ export class TelegramUpdates {
// await ctx.reply(`Tôi đọc được chữ từ tin nhắn cũ: ${textInMessage}`);
await this.sharedAutoComment(ctx, textInMessage);
await this.sharedAutoComment(ctx, textInMessage, accountX);
}
private async sharedAutoComment(ctx: Context, linkX:string): Promise<void> {
private async sharedAutoComment(ctx: Context, linkX: string, accountX: string): Promise<void> {
// console.log(ctx);
// @ts-ignore
if (!linkX) {
@@ -164,7 +169,7 @@ export class TelegramUpdates {
await this.managerService.triggerAutoGenerateCommentTwitter(
linkX,
'realflashkaze',
accountX,
'en',
chatId,
);
@@ -956,7 +961,10 @@ export class TelegramUpdates {
await ctx.reply(text, {
reply_markup: {
inline_keyboard: [
[{ text: '📥 Chạy lệnh auto cmt', callback_data: 'action_auto_comment' }]
[
{text: '📥 Chạy lệnh auto cmt flashkaze', callback_data: 'action_auto_comment_realflashkaze'},
{text: '📥 Chạy lệnh auto cmt ech com', callback_data: 'action_auto_comment_echcomvuive'}
]
]
}
});