# Telegram Echo server
require 'eureka-bot'
class TgController::CommandsController < TgController
def start
answer(
method: 'sendMessage',
params: {
text: 'Hi! Please send me _some_ message',
parse_mode: 'Markdown',
}
)
end
def help
answer(
method: 'sendMessage',
params: {
text: 'Just send message'
}
)
end
end
class TgController::TextController < TgController
def text
answer(
method: 'sendMessage',
params: {
text: message.dig('message', 'text'),
}
)
end
end
Add this line to your application's Gemfile:
gem 'eureka-bot-tg'
And then execute:
$ bundle
Or install it yourself as:
$ gem install eureka-bot-tg
Please check examples directory
Bug reports and pull requests are welcome on GitHub at https://github.com/dizer/eureka-bot-tg. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.