tourmaline v0.20.0 Release NotesRelease Date: 2020-06-08 // 9 months ago
🚀 Ok so this release removes the filters added several releases back. I didn't like how filters forced people to think and they weren't very Crystally in function. The main issue with them was trying to allow a developer to receive information about the update being filtered. I tried to solve this using
Update#context, but it was majorly limited and pretty messy.
🖐 So handlers are back and better than ever! I had initially gotten rid of handlers because I couldn't figure out a way to handle them that wasn't messy. In the initial revision each handler was its own class, but the annotation logic for the handler was contained in the base
EventHandlerclass. This made it hard to figure out an easy way for people to add their own handlers without also being able to modify the method within
EventHandlers::Annotatorthat handled the annotation logic.
⚡️ Well no more!
EventHandleris now a very simple abstract class that requires one method,
call(update : Update). If a subclass includes a
self.annotatemethod that method will be called when the client is initialized. There are also several new handlers that didn't exist before, based on the filters they replaced, including
InlineQueryHandler, and the standard
UpdateHandler. I highly recommend checking out the API docs on each of them.
⚡️ This update also brings
RoutedMenufor easy creation of menus using inline keyboards.
Previous changes from v0.19.1
- Replace broken
Intin unions with
- 👉 Make
Helpers.random_stringactually return a random string, not just a number
- 🔄 Change the first run logic in
- Replace broken