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> { async onWizardCommand(@Ctx() ctx: Scenes.SceneContext): Promise<void> {
await ctx.scene.enter(WIZARD_COMMENT_SCENE_ID); await ctx.scene.enter(WIZARD_COMMENT_SCENE_ID);
} }
@Command('chatid') @Command('chatid')
async onGetChatId(ctx: Context) { async onGetChatId(ctx: Context) {
// @ts-ignore // @ts-ignore
@@ -127,12 +128,16 @@ export class TelegramUpdates {
await ctx.reply(`vui lòng đưa topic, ví dụ: /${command} LinkX`); await ctx.reply(`vui lòng đưa topic, ví dụ: /${command} LinkX`);
return; 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) { async onDownloadAction(@Ctx() ctx: Context) {
await ctx.answerCbQuery(); // Tắt trạng thái loading trên nút bấm 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ữ // Ép kiểu để ép TypeScript nhận diện đúng đối tượng tin nhắn chữ
// @ts-ignore // @ts-ignore
const message = ctx.callbackQuery.message as any; 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 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); // console.log(ctx);
// @ts-ignore // @ts-ignore
if (!linkX) { if (!linkX) {
@@ -164,7 +169,7 @@ export class TelegramUpdates {
await this.managerService.triggerAutoGenerateCommentTwitter( await this.managerService.triggerAutoGenerateCommentTwitter(
linkX, linkX,
'realflashkaze', accountX,
'en', 'en',
chatId, chatId,
); );
@@ -956,7 +961,10 @@ export class TelegramUpdates {
await ctx.reply(text, { await ctx.reply(text, {
reply_markup: { reply_markup: {
inline_keyboard: [ 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'}
]
] ]
} }
}); });