Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs');
- const Telegraf = require('telegraf')
- const { Extra, Markup } = Telegraf
- const bot = new Telegraf('351418414:AAHdR3w9tlI-BmEN6cNQepkHfhms4cjdWmk')
- bot.use(Telegraf.log())
- bot.hears('🔍 ЧаВо', (ctx) => {
- fs.readFile('./faq_ru.txt','utf8', function read(err, text) {
- console.log(text);
- ctx.replyWithHTML(text, Markup
- .keyboard([
- ['🏠 На главную']
- ])
- .oneTime().resize().extra()
- )
- })
- })
- bot.hears('🔍 FAQ', (ctx) => {
- fs.readFile('./faq_en.txt','utf8', function read(err, text) {
- console.log(text);
- ctx.replyWithHTML(text, Markup
- .keyboard([
- ['🏠 To main']
- ])
- .oneTime().resize().extra()
- )
- })
- })
- bot.hears('👥 О нас', (ctx) => {
- fs.readFile('./about_ru.txt','utf8', function read(err, text) {
- console.log(text);
- ctx.reply(text, Markup
- .keyboard([
- ['💾 Наша история'],
- ['🏠 На главную']
- ])
- .oneTime().resize().extra()
- )
- })
- })
- bot.hears('👥 About us', (ctx) => {
- fs.readFile('./about_en.txt','utf8', function read(err, text) {
- console.log(text);
- ctx.reply(text, Markup
- .keyboard([
- ['💾 Our history'],
- ['🏠 To main']
- ])
- .oneTime().resize().extra()
- )
- })
- })
- bot.hears('💾 Наша история', (ctx) => {
- fs.readFile('./history_ru.txt','utf8', function read(err, text) {
- console.log(text);
- ctx.reply(text, Markup
- .keyboard([
- ['🏠 На главную']
- ])
- .oneTime().resize().extra()
- )
- })
- })
- bot.hears('💾 Our history', (ctx) => {
- fs.readFile('./history_en.txt','utf8', function read(err, text) {
- console.log(text);
- ctx.reply(text, Markup
- .keyboard([
- ['🏠 To main']
- ])
- .oneTime().resize().extra()
- )
- })
- })
- bot.hears(['/start', '/help', '🇷🇺 Сменить язык', '🏠 На главную'], ({ reply }) => {
- return reply('🇷🇺 Язык изменен', Markup
- .keyboard([
- ['👥 О нас', '🔍 ЧаВо'],
- ['📞 Связяться с нами'],
- ["🇬🇧 Change language"]
- ])
- .oneTime()
- .resize()
- .extra()
- )
- })
- bot.hears(['🇬🇧 Change language', '🏠 To main'], ({ reply }) => {
- return reply('🇬🇧Language changed', Markup
- .keyboard([
- ['👥 About us', '🔍 FAQ'],
- ['📞 Connect with us'],
- ['🇷🇺 Сменить язык']
- ])
- .oneTime()
- .resize()
- .extra()
- )
- })
- bot.hears(['📞 Связяться с нами'], ({ reply }) => {
- return reply('VK.com/nocell\nt.me/nocell\n', Markup
- .keyboard([
- ["🏠 На главную"]
- ])
- .oneTime()
- .resize()
- .extra()
- )
- })
- bot.hears(['📞 Connect with us'], ({ reply }) => {
- return reply('VK.com/nocell\nt.me/nocell\n', Markup
- .keyboard([
- ["🏠 To main"]
- ])
- .oneTime()
- .resize()
- .extra()
- )
- })
- bot.startPolling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement