Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sending messages to channels #7

Closed
4 tasks done
pietroalbini opened this issue Oct 9, 2015 · 2 comments
Closed
4 tasks done

Add support for sending messages to channels #7

pietroalbini opened this issue Oct 9, 2015 · 2 comments

Comments

@pietroalbini
Copy link
Contributor

Yesterday Telegram added support for channels in the API, so this should be implemented in botogram.

But I don't want to push changes without the ability to test them, and currently no Telegram client supports marking a bot as administrator of a channel.
Now that all the major clients supports adding bots as channel administrators, this can be implemented. The Bot.send method should be fairly easy to fix, but I also want to add an API for the ones who just want to manage the channel.

This is because creating a bot instance just for sending a message to a channel, maybe in an big script, is just a waste of resources. So I designed this API:

import botogram

chan = botogram.channel("@channel_name", "12345678:api_key")
chan.send("Hi there!")

botogram.channel will return an instance of botogram.Chat, so it won't trigger the initialization of the bot instance.

  • Design the API
  • Wait for Telegram clients to support this
  • Do the actual implementation
  • Write a chapter in the documentation
pietroalbini pushed a commit that referenced this issue Oct 9, 2015
The GroupChat object was removed, and a generic Chat object was introduced
instead of the old one. This object is used for private conversations, group
chats and channels, so the Message.chat attribute won't contain anymore the
User or the GroupChat object, but only the Chat one.

Also the API change introduced support for managing channels. Details of the
implementation are tracked on issue #7.
@pietroalbini pietroalbini added this to the botogram 1.0 milestone Oct 9, 2015
@pietroalbini
Copy link
Contributor Author

Updated the issue with an API design.

@pietroalbini
Copy link
Contributor Author

Merged two days ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant