From be60e1a9db83d3604365c83a8f86dd4a307c63f9 Mon Sep 17 00:00:00 2001 From: fengkx Date: Mon, 24 Dec 2018 00:03:40 +0800 Subject: [PATCH] fix error of export and delete button when cancel --- index.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 0a030ec4989..520926dbf7d 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,7 @@ const i18n = require('./i18n'); const { getUrl, - exportToopml, + exportToOpml, importFromOpml, getFileLink, sendError, @@ -88,12 +88,17 @@ bot.command('allunsub', bot.action('UNSUB_ALL_YES', sendError, isAdmin, - RSS.unsubAll + RSS.unsubAll, + async (ctx, next) => { + const cb = ctx.callbackQuery; + const res = await ctx.telegram.answerCbQuery(); + } ); bot.action('UNSUB_ALL_NO', async (ctx, next) => { const cb = ctx.callbackQuery; - const res = await ctx.telegram.answerCallbackQuery(cb.id, i18n['CANCEL']); + const res = await ctx.telegram.answerCbQuery(cb.id, i18n['CANCEL']); + await ctx.telegram.deleteMessage(cb.from.id , cb.message.message_id); }); bot.command('rss', @@ -104,7 +109,7 @@ bot.command('rss', bot.command('export', sendError, - exportToopml + exportToOpml ); bot.startPolling();