README.md in tg-bot-0.0.3 vs README.md in tg-bot-0.0.4

- old
+ new

@@ -11,11 +11,11 @@ ```yaml telegram_bot_token: Your bot token ``` 2. Add this gem to your `Gemfile` ```ruby - gem 'tg-bot', '~> 0.0.2' + gem 'tg-bot' ``` 3. Setup your Controller > e.g. my webhook is https://xxxxx/telegram ```ruby def telegram @@ -40,11 +40,82 @@ telegram.send_photo(photo: "https://picsum.photos/200/300/?random=#{Random.new_seed}") end ``` # Methods -## setWebhook +## [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) 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.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', + disable_notification: 'true / false', + reply_to_message_id: 'message_id', + reply_markup: 'inline keyboard, custom reply keyboard' + ) +end +``` +||type|memo| +|---|---|---| +|chat_id|Integer / String|**Required**<br>Default: chat_id from params| +|text|String|**Required**<br>Enter reply Message| +|parse_mode|String|**Optional**<br>Default: `HTML`<br>[HTML](https://core.telegram.org/bots/api#html-style) / [Markdown](https://core.telegram.org/bots/api#markdown-style)| +|disable_web_page_preview|Boolean|**Optional**<br>true / false| +|disable_notification|Boolean|**Optional**<br>true / false| +|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.forward_message( + chat_id: 'chat_id', + from_chat_id: 'chat_id from forward message', + message_id: 'message_id forward message', + disable_notification: 'true / false' + ) +end +``` +||type|memo| +|---|---|---| +|chat_id|Integer / String|**Required**<br>Default: chat_id from params| +|from_chat_id|Integer|**Required**<br>Chat Id from forward message| +|message_id|String|**Required**<br>Message Id from forward message| +|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.send_photo( + chat_id: 'chat_id', + photo: 'InputFile / File Id(String) / HTTP URL(String)', + caption: 'Photo caption', + parse_mode: 'HTML / Markdown ( Default Setting: HTML )', + disable_notification: 'true / false', + reply_to_message_id: 'message_id', + reply_markup: 'inline keyboard, custom reply keyboard' + ) +end +``` +||type|memo| +|---|---|---| +|chat_id|Integer / String|**Required**<br>Default: chat_id from params| +|photo|InputFile / String|**Required**<br>There's 3 ways to send photo:<br>1. Use `multipart/form-data` to upload new photo.<br>2. If the photo exist on Telegram servers, then pass `file_id` as String to send a photo.<br>3. Pass an HTTP URL as a String for Telegram to get a photo from the Internet.<br>[more](https://core.telegram.org/bots/api#sendphoto)| +|caption|String|**Optional**<br>Photo caption (may also be used when resending photos by file_id)<br>***maximun characters : 1024***| +|parse_mode|String|**Optional**<br>Default: `HTML`<br>[HTML](https://core.telegram.org/bots/api#html-style) / [Markdown](https://core.telegram.org/bots/api#markdown-style)| +|disable_notification|Boolean|**Optional**<br>true / false| +|reply_to_message_id|Integer|**Optional**<br>Reply sb's message by message_id| + +# Other +If you have any questions or better advice for this gem, please use [Issue](https://github.com/VenseChang/telegram-bot-gem/issues/new) to tell me. +Thanks for using this gem. \ No newline at end of file