Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'telegram/bot'
- token = ''
- Telegram::Bot::Client.run(token) do |bot|
- bot.listen do |message|
- #case message.text
- case message
- when Telegram::Bot::Types::Message
- bot.api.send_message(chat_id: message.chat.id, text: "Hello, #{message.from.first_name}!")
- break
- case message.text
- when '/photo'
- bot.api.send_photo(chat_id: message.chat.id, photo: Faraday::UploadIO.new('/home/iceice/Work/telegram/robot/image/404.jpg', 'image/jpeg'))
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement