Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. const fs = require('fs');
  2.  
  3. const Telegraf = require('telegraf')
  4. const { Extra, Markup } = Telegraf
  5.  
  6. const bot = new Telegraf('351418414:AAHdR3w9tlI-BmEN6cNQepkHfhms4cjdWmk')
  7.  
  8. bot.use(Telegraf.log())
  9.  
  10. bot.hears('🔍 ЧаВо', (ctx) => {
  11. fs.readFile('./faq_ru.txt','utf8', function read(err, text) {
  12. console.log(text);
  13. ctx.replyWithHTML(text, Markup
  14. .keyboard([
  15. ['🏠 На главную']
  16. ])
  17. .oneTime().resize().extra()
  18. )
  19. })
  20. })
  21.  
  22. bot.hears('🔍 FAQ', (ctx) => {
  23. fs.readFile('./faq_en.txt','utf8', function read(err, text) {
  24. console.log(text);
  25. ctx.replyWithHTML(text, Markup
  26. .keyboard([
  27. ['🏠 To main']
  28. ])
  29. .oneTime().resize().extra()
  30. )
  31. })
  32. })
  33.  
  34. bot.hears('👥 О нас', (ctx) => {
  35. fs.readFile('./about_ru.txt','utf8', function read(err, text) {
  36. console.log(text);
  37. ctx.reply(text, Markup
  38. .keyboard([
  39. ['💾 Наша история'],
  40. ['🏠 На главную']
  41. ])
  42. .oneTime().resize().extra()
  43. )
  44. })
  45. })
  46.  
  47. bot.hears('👥 About us', (ctx) => {
  48. fs.readFile('./about_en.txt','utf8', function read(err, text) {
  49. console.log(text);
  50. ctx.reply(text, Markup
  51. .keyboard([
  52. ['💾 Our history'],
  53. ['🏠 To main']
  54. ])
  55. .oneTime().resize().extra()
  56. )
  57. })
  58. })
  59.  
  60.  
  61.  
  62. bot.hears('💾 Наша история', (ctx) => {
  63. fs.readFile('./history_ru.txt','utf8', function read(err, text) {
  64. console.log(text);
  65. ctx.reply(text, Markup
  66. .keyboard([
  67. ['🏠 На главную']
  68. ])
  69. .oneTime().resize().extra()
  70. )
  71. })
  72. })
  73.  
  74.  
  75.  
  76. bot.hears('💾 Our history', (ctx) => {
  77. fs.readFile('./history_en.txt','utf8', function read(err, text) {
  78. console.log(text);
  79. ctx.reply(text, Markup
  80. .keyboard([
  81. ['🏠 To main']
  82. ])
  83. .oneTime().resize().extra()
  84. )
  85. })
  86. })
  87.  
  88.  
  89.  
  90. bot.hears(['/start', '/help', '🇷🇺 Сменить язык', '🏠 На главную'], ({ reply }) => {
  91. return reply('🇷🇺 Язык изменен', Markup
  92. .keyboard([
  93. ['👥 О нас', '🔍 ЧаВо'],
  94. ['📞 Связяться с нами'],
  95. ["🇬🇧 Change language"]
  96. ])
  97. .oneTime()
  98. .resize()
  99. .extra()
  100. )
  101. })
  102.  
  103.  
  104. bot.hears(['🇬🇧 Change language', '🏠 To main'], ({ reply }) => {
  105. return reply('🇬🇧Language changed', Markup
  106. .keyboard([
  107. ['👥 About us', '🔍 FAQ'],
  108. ['📞 Connect with us'],
  109. ['🇷🇺 Сменить язык']
  110. ])
  111. .oneTime()
  112. .resize()
  113. .extra()
  114. )
  115. })
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. bot.hears(['📞 Связяться с нами'], ({ reply }) => {
  124. return reply('VK.com/nocell\nt.me/nocell\n', Markup
  125. .keyboard([
  126. ["🏠 На главную"]
  127. ])
  128. .oneTime()
  129. .resize()
  130. .extra()
  131. )
  132. })
  133.  
  134. bot.hears(['📞 Connect with us'], ({ reply }) => {
  135. return reply('VK.com/nocell\nt.me/nocell\n', Markup
  136. .keyboard([
  137. ["🏠 To main"]
  138. ])
  139. .oneTime()
  140. .resize()
  141. .extra()
  142. )
  143. })
  144.  
  145.  
  146. bot.startPolling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement