127 subscribers
1 photo
1 video
48 links
Python framework for Telegram bots
Download Telegram
botogram 0.2.1 is now out to fix a little issue with the /help default command. No breaking changes are in it, so updates are recommended.

Changelog:
https://botogram.pietroalbini.io/docs/0.2/changelog/#botogram-0-2-1

Update it right now:
# Linux and OSX
$ python3 -m pip install -U "botogram==0.2.1"
# Windows
C:\> py -3 -m pip install -U "botogram==0.2.1"


If you notice any issues with the new release feel free to report them in the issue tracker, and if you want to discuss about new features for botogram 0.3 hop into the @botogram_users group!
I'm thinking about a bigger future for botogram. Please give your opinions on the issue!
https://github.com/pietroalbini/botogram/issues/52
The first new feature of botogram 0.3 landed on master! You can now easily react when a chat is not available (for example the user blocked your bot).

Check out the documentation: https://botogram.pietroalbini.io/docs/dev/unavailable-chats

If you have any idea for the future of botogram or you want to discuss this change, join the @botogram_users group!
By the way, new features introduced today like groups management will be included in botogram 0.3.
Update: I just tested, nothing broke
A bunch of new things were added in the Bot API 2.0 update of the Telegram API! All the new features (except for inline queries and maybe keyboards if I have time to implement them in a timely manner after the other things) will be included in botogram 0.3!

Meta issue which tracks the progress for implementing everything:
https://github.com/pietroalbini/botogram/issues/61
The first batch of new features from the Bot API 2.0 update landed on master: the renamed properties are now renamed in botogram (with the old syntax deprecated), and support for editing messages was added. If you want to try them out build botogram from source.

There are lots of new things to implement, and I'm quite busy with real-life stuff at the moment, so if you want to help out just take an unassigned issue!
https://github.com/pietroalbini/botogram/issues/61

Discussion group: @botogram_users
Support for Message.pinned_message also landed on master. Unfortunately, the following ones will be very busy weeks for me, so I can't guarantee new features...

Discussion group: @botogram_users
I'm starting to get a little more free time, but I'm still quite busy. In the meantime I fixed a small compatibility error in the development version, so if you're using it upgrade :)

Discussion group: @botogram_users
A branch I was working on for some time was just merged on master: support for Message.parsed_text (introduced in the Bot API 2.0 update)!

The implementation I created is quite different than the one created by Telegram: for example, you don't get the offset of the entity and its length but just the text of it, plain text is included as an entity and types are a little more sane.

I'm slowly getting more free time, but this week should be the last one with big school projects! I'll probably also release botogram 0.3 as soon as compatibility with the new features introduced by Telegram is reached, and delay keyboards and conversations for 0.4 (I don't want you to wait too much for these features!).

Discussion group: @botogram_users
Sorry for the spare updates but I'm not feeling so good in this weeks (damn you spring!).

Today I fixed the ugly behavior and messages when two instances of the same bot were running: Telegram doesn't support that, and botogram was just spamming a lot of messages before. Now, it tells you what's wrong, and it quietly checks when the other instances are closed, and then it starts working again.

Discussion group: @botogram_users
The old way to hide commands from /help (adding them to the bot.hide_commands list) was ugly and error-prone, so I decided to change the whole thing. Starting with botogram 0.3, the way to hide commands will be to provide the hidden=True argument either to @bot.command or self.add_command (for components).

This allows components to force a specific command to be hidden, and also keeps the code cleaner by putting those information near the command definition.

Discussion group: @botogram_users
Today two small changes landed on master: support for messages forwarded from channels and a new Chat.leave() method.

I'm going to delay everything but the new things introduced in the recent (2.0 and 2.1) updates of the Bot API, so you can use the new features as soon as possible. Unfortunately, this means the new shared state, keyboards and inlines are delayed until botogram 0.4.

Discussion group: @botogram_users
No more waiting when you restart your bot after some time! A code change in botogram 0.3 makes the whole backlog-skipping project instantaneous.

https://github.com/pietroalbini/botogram/commit/02a98fe9de1ed9fb0a2708e65cd801ef9466277c
Discussion group: @botogram_users
I just redesigned from scratch the API for keyboards and buttons (inline keyboards), which will be implemented in botogram 0.4. If you want to take a peek at it, check it out on GitHub!

https://github.com/pietroalbini/botogram/issues/66
Discussion group: @botogram_users
A bunch of new things landed on master today!

You can now get the list of administrators of a chat. If your bot is meant to be added in groups to aid moderating, being able to accept certain commands only from appointed administrators is quite helpful. Check out the documentation for it:
https://botogram.pietroalbini.io/docs/dev/api/telegram/#botogram.Chat.admins

If the command you want to protect is really dangerous, and only the chat creator should be allowed to use it, don't worry! You can check if it's him by comparing the sender with chat.creator. Check out the documentation for it:
https://botogram.pietroalbini.io/docs/dev/api/telegram/#botogram.Chat.creator

Also, you might want to track statistics about how many users are in your group or subscribed to your channel. It's now easy to get that information with chat.members_count! Check out the documentation for it:
https://botogram.pietroalbini.io/docs/dev/api/telegram/#botogram.Chat.members_count

Checking if someone is kicked from the chat or is an admin of it was difficult before, because you had to track that down by yourself. Now you can just check the status in the group of an user by using chat.status_of(). Check out the documentation for it:
https://botogram.pietroalbini.io/docs/dev/api/telegram/#botogram.Chat.status_of

Finally, it's now possible to compare (for example message.sender == chat.creator) most of the upstream objects, like User, Chat, Message and many more. This allows you to do nice things like if message.sender in chat.admins:.

Discussion group: @botogram_users
A few new features landed yesterday on master!

It will be possible in botogram 0.3 to process edits of the messages your bot knows about. Check out the documentation for it:
https://botogram.pietroalbini.io/docs/dev/api/bot/#botogram.Bot.message_edited

Also, a small bug was fixed, and now you shouldn't have more troubles if you use any > or < in your commands' docstrings but you don't have any HTML syntax in there: your docstrings will be escaped automatically, and the /help command shouldn't crash anymore.

Discussion group: @botogram_users