Guest User

Untitled

a guest
Dec 11th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. require 'telegram_bot'
  2.  
  3. bot = TelegramBot.new(token: 'token api')
  4. bot.get_updates(fail_silently: true) do |message|
  5. puts "@#{message.from.username}: #{message.text}"
  6.  
  7. command = message.get_command_for(bot)
  8.  
  9. message.reply do |reply|
  10. case command
  11. when /start/i
  12. reply.text = "Hi Try /help for command list."
  13. when /help/i
  14. reply.text = "A list of commands that you can use.
  15.  
  16. /greet - greets new users.
  17.  
  18. /website - Provides a link to the Connect Platform.
  19.  
  20. /price - Displays current price.
  21.  
  22. /supply - Total circulating supply."
  23. when /greet/i
  24. reply.text = "Hello, #{message.from.first_name}. 🤖 Welcome to Connect
  25. telegram, If you need any /help just ask."
  26. when /website/i
  27. reply.text = "welcome, #{message.from.first_name} to the Connect
  28. Platform."
  29. when /price/i
  30. reply.text = "Current price of
  31. when /supply/i
  32. reply.text = "Circulating supply.
  33. when /hi/i
  34. reply.text = "Hi, #{message.from.first_name} Welcome to Connect
  35. telegram, If you need any /help just ask."
  36. if
  37. reply.text = "Hi, #{message.from.new_chat_member}Welcome to the
  38. connect telegram channel"
  39. end
  40. else
  41. reply.text = "Hi, #{message.from.first_name} I do not know what #
  42. {command.inspect} means, try /help for command list"
  43. end
  44. puts "sending #{reply.text.inspect} to @#{message.from.username}"
  45. reply.send_with(bot)
  46. end
  47. end
Add Comment
Please, Sign In to add comment