Skip to content

Commit

Permalink
fix error of export and delete button when cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
fengkx committed Dec 23, 2018
1 parent 8ac1f22 commit be60e1a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const i18n = require('./i18n');

const {
getUrl,
exportToopml,
exportToOpml,
importFromOpml,
getFileLink,
sendError,
Expand Down Expand Up @@ -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',
Expand All @@ -104,7 +109,7 @@ bot.command('rss',

bot.command('export',
sendError,
exportToopml
exportToOpml
);

bot.startPolling();
Expand Down

0 comments on commit be60e1a

Please sign in to comment.