Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #41 from rozhok/5
Browse files Browse the repository at this point in the history
#5 Add send message instructions to README
  • Loading branch information
eljojo authored Jun 9, 2018
2 parents f286937 + 4df22af commit b545496
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
*.a
mkmf.log
/.idea/
*.iml
*.ipr
*.iws
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,25 @@ reply.text = "i'll do it after going to moe's"
bot.send_message(reply)
```

To send message to specific channel you could do following:

```ruby
bot = TelegramBot.new(token: '[YOUR TELEGRAM BOT TOKEN GOES HERE]')
channel = TelegramBot::Channel.new(id: channel_id)
message = TelegramBot::OutMessage.new
message.chat = channel
message.text = 'Some message'

message.send_with(bot)

```

Also you may pass additional options described in [API Docs](https://core.telegram.org/bots/api#sendmessage)

```ruby
message.parse_mode = 'Markdown'
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/eljojo/telegram_bot. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://www.contributor-covenant.org/) code of conduct.
Expand Down

0 comments on commit b545496

Please sign in to comment.