README.md in tg-bot-0.0.4 vs README.md in tg-bot-0.0.5
- old
+ new
@@ -17,18 +17,18 @@
```
3. Setup your Controller
> e.g. my webhook is https://xxxxx/telegram
```ruby
def telegram
- telegram = Telegram::Bot.new(params)
+ telegram = Telegram::Bot.new(params: params, telegram_bot_token: ENV['telegram_bot_token'])
end
```
4. It has 3 ways to reply message
```ruby
def telegram
- telegram = Telegram::Bot.new(params)
+ telegram = Telegram::Bot.new(params: params, telegram_bot_token: ENV['telegram_bot_token'])
# 1. reply text message
telegram.send_message(text: 'enter what you want to reply')
# 2. reply forward_message
@@ -43,18 +43,18 @@
# Methods
## [SetWebhook](https://github.com/VenseChang/telegram-bot-gem/blob/4b896317db7804cf8f5191974f5e942872300ba3/lib/tg-bot.rb#L25-L28)
```ruby
def xxx
- Telegram::Bot::SetWebhook(url)
+ Telegram::Bot::SetWebhook(url: url, token: ENV['telegram_bot_token'])
end
```
## [Send Message](https://github.com/VenseChang/telegram-bot-gem/blob/develop/lib/telegram/reply/send_message.rb)
```ruby
def telegram
- telegram = Telegram::Bot.new(params)
+ telegram = Telegram::Bot.new(params: params, telegram_bot_token: ENV['telegram_bot_token'])
telegram.send_message(
chat_id: 'chat_id',
text: 'Enter you want to reply message text',
parse_mode: 'HTML / Markdown ( Default Setting: HTML )',
disable_web_page_preview: 'true / false',
@@ -74,11 +74,11 @@
|reply_to_message_id|Integer|**Optional**<br>Reply sb's message by message_id|
## [Forward Message](https://github.com/VenseChang/telegram-bot-gem/blob/develop/lib/telegram/reply/forward_message.rb)
```ruby
def telegram
- telegram = Telegram::Bot.new(params)
+ telegram = Telegram::Bot.new(params: params, telegram_bot_token: ENV['telegram_bot_token'])
telegram.forward_message(
chat_id: 'chat_id',
from_chat_id: 'chat_id from forward message',
message_id: 'message_id forward message',
disable_notification: 'true / false'
@@ -93,10 +93,10 @@
|disable_notification|Boolean|**Optional**<br>true / false|
## [Send Photo](https://github.com/VenseChang/telegram-bot-gem/blob/develop/lib/telegram/reply/send_photo.rb)
```ruby
def telegram
- telegram = Telegram::Bot.new(params)
+ telegram = Telegram::Bot.new(params: params, telegram_bot_token: ENV['telegram_bot_token'])
telegram.send_photo(
chat_id: 'chat_id',
photo: 'InputFile / File Id(String) / HTTP URL(String)',
caption: 'Photo caption',
parse_mode: 'HTML / Markdown ( Default Setting: HTML )',
\ No newline at end of file