Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'telegram_bot'
- bot = TelegramBot.new(token: 'token api')
- bot.get_updates(fail_silently: true) do |message|
- puts "@#{message.from.username}: #{message.text}"
- command = message.get_command_for(bot)
- message.reply do |reply|
- case command
- when /start/i
- reply.text = "Hi Try /help for command list."
- when /help/i
- reply.text = "A list of commands that you can use.
- /greet - greets new users.
- /website - Provides a link to the Connect Platform.
- /price - Displays current price.
- /supply - Total circulating supply."
- when /greet/i
- reply.text = "Hello, #{message.from.first_name}. 🤖 Welcome to Connect
- telegram, If you need any /help just ask."
- when /website/i
- reply.text = "welcome, #{message.from.first_name} to the Connect
- Platform."
- when /price/i
- reply.text = "Current price of
- when /supply/i
- reply.text = "Circulating supply.
- when /hi/i
- reply.text = "Hi, #{message.from.first_name} Welcome to Connect
- telegram, If you need any /help just ask."
- if
- reply.text = "Hi, #{message.from.new_chat_member}Welcome to the
- connect telegram channel"
- end
- else
- reply.text = "Hi, #{message.from.first_name} I do not know what #
- {command.inspect} means, try /help for command list"
- end
- puts "sending #{reply.text.inspect} to @#{message.from.username}"
- reply.send_with(bot)
- end
- end
Add Comment
Please, Sign In to add comment