diff --git a/controllers/menu.js b/controllers/menu.js index 7e74241..30433bf 100644 --- a/controllers/menu.js +++ b/controllers/menu.js @@ -189,9 +189,6 @@ bot.on('callback_query', msg => { }], [{ text: 'Reddit', callback_data: 'cmd_reddit' - }, { - text: 'Repost', - callback_data: 'cmd_repost' }, { text: 'Urban Dictionary', callback_data: 'cmd_urbandictionary' @@ -253,10 +250,6 @@ bot.on('callback_query', msg => { bot.editMessageText(`${lang.reddit}`, cmdParams) } - if (msg.data === 'cmd_repost') { - bot.editMessageText(`${lang.repost}`, cmdParams) - } - if (msg.data === 'cmd_urbandictionary') { bot.editMessageText(`${lang.urbandictionary}`, cmdParams) } diff --git a/controllers/repost.js b/controllers/repost.js deleted file mode 100644 index a967c1e..0000000 --- a/controllers/repost.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -const bot = require('../core/telegram') - -bot.onText(/^[/!#]repost (.+)/, (msg, match) => { - if (msg.reply_to_message) { - const message = msg.reply_to_message - let [chatId, ...captext] = `${match[1]}`.split(' ') - const CAPTEXT = {caption: captext.join(' ')} - - if (message.photo) { - bot.sendPhoto(chatId, message.photo[0].file_id, CAPTEXT) - } - if (message.voice) { - bot.sendVoice(chatId, message.voice.file_id, CAPTEXT) - } - if (message.audio) { - bot.sendAudio(chatId, message.audio.file_id, CAPTEXT) - } - if (message.video) { - bot.sendVideo(chatId, message.video.file_id, CAPTEXT) - } - if (message.document) { - bot.sendDocument(chatId, message.document.file_id, CAPTEXT) - } - if (message.text) { - bot.sendMessage(chatId, message.text, { - parse_mode: 'HTML' - }) - } - } -})