README.md in telegram-bot-ruby-0.4.2 vs README.md in telegram-bot-ruby-0.5.0.beta1
- old
+ new
@@ -108,21 +108,21 @@
```ruby
bot.listen do |message|
case message.text
when '/photo'
- bot.api.send_photo(chat_id: message.chat.id, photo: File.new('~/Desktop/jennifer.jpg'))
+ bot.api.send_photo(chat_id: message.chat.id, photo: Faraday::UploadIO.new('~/Desktop/jennifer.jpg', 'image/jpeg'))
end
end
```
## Logging
By default, bot doesn't log anything (uses `NullLoger`). You can change this behavior and provide your own logger class. See example below:
```ruby
-Telegram::Bot::Client.run(token, logger: Logger.new($stdout)) do |bot|
+Telegram::Bot::Client.run(token, logger: Logger.new($stderr)) do |bot|
bot.logger.info('Bot has been started')
bot.listen do |message|
# ...
end
end
@@ -152,17 +152,9 @@
`#track` method accepts 3 arguments:
- name of event (required)
- Telegram's user id (required)
- hash of additional properties (optional)
-
-## Connection pool size
-
-Sometimes you need to do some heavy work in another thread and send response from there. In this case you have to increase your connection pool size (by default it's *1*). You can do it by setting env variable `TELEGRAM_BOT_POOL_SIZE`:
-
-```shell
-$ TELEGRAM_BOT_POOL_SIZE=4 ruby bot.rb
-```
## Boilerplates
If you don't know how to setup database for your bot or how to use it with different languages here are some boilerplates which can help you to start faster:
- [Ruby Telegram Bot boilerplate](https://github.com/telegram-bots/ruby-telegram-bot-boilerplate)