All Versions
23
Latest Version
Avg Release Cycle
19 days
Latest Release
-

Changelog History
Page 1

  • v0.23.0 Changes

    • โž• Added full support for Bot API 5.1 - 5.3
    • ๐Ÿ›  Fixed some dependencies.
    • โž• Added additional classes ChatInviteLink, VoiceChatStarted, VoiceChatEnded, VoiceChatParticipantInvited, VoiceChatScheduled, MessageAutoDeleteTimerChanged, InputInvoiceMessageContent, and BotCommandScope.
    • Added scope and language_code options to set_my_commands and get_my_commands.
    • Added method delete_my_commands.
    • ๐Ÿ‘€ More, see the official Bot API changelog for a complete list of changes.
  • v0.22.0 Changes

    • โž• Added support for TDLight.
    • โž• Added user_token argument to Client.new to support the TDLight user API.
    • (breaking change) All arguments to Client.new are now keyword arguments.
    • (breaking change) Removed async argument from event handlers. All events are now async by default. Async events can be disabled with the -Dno_async flag.
    • โšก๏ธ UpdateHandler now accepts an array of UpdateAction, or a single one.
    • ๐Ÿ›  Fixed an issue where poll always deletes a set webhook. Now it will only delete the webhook if delete_webhook is true.
  • v0.20.0 Changes

    June 08, 2020

    ๐Ÿš€ 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 EventHandler class. 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::Annotator that handled the annotation logic.

    โšก๏ธ Well no more! EventHandler is now a very simple abstract class that requires one method, call(update : Update). If a subclass includes a self.annotate method 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 CommandHandler, HearsHandler, CallbackQueryHandler, ChosenInlineResultHandler, InlineQueryHandler, and the standard UpdateHandler. I highly recommend checking out the API docs on each of them.

    โšก๏ธ This update also brings RoutedMenu for easy creation of menus using inline keyboards.

  • v0.19.1 Changes

    June 05, 2020
    • Replace broken Int in unions with Int::Primitive
    • ๐Ÿ‘‰ Make Helpers.random_string actually return a random string, not just a number
    • ๐Ÿ”„ Change the first run logic in Stage
  • v0.19.0 Changes

    June 05, 2020

    โšก๏ธ This is a pretty massive update, and there's way too much to go into here. Basically though, if I were to break this update down into a couple achievements this is what we have:

    Connection Pooling

    I, and others, were having some issues earlier on using the client in a concurrent environment. This is because the client was using a single HTTP::Client which was being shared between threads/fibers. When one fiber would finish it would close the connection, causing a very confusing stack trace that said nothing about what the root of the problem was.

    ๐ŸŽ After much testing and debugging I decided to add a connection pool, which is basically like a library of HTTP::Client instances. The pool has a finite number of instances it can spawn, and starts with a limited number. When a request is made the client checks out a client, uses it, and then checks it back in to the pool. It's thread safe and works perfectly, at a very small cost to performance.

    Proxies

    Another requested feature was proxy support. Unfortunately Crystal's HTTP::Client doesn't support proxies itself, but thanks to mamantoha/http_proxy I was able to implement proxy support pretty easily. The Client initializer now accepts several parameters for configuring the proxy as well.

    PagedInlineKeyboard

    ๐Ÿ‘€ I added a convenience class for creating paginated inline keyboards called PagedInlineKeyboard. You can see it in action in the pagination bot example.

    Stage

    Last, but certainly not least, I have finally managed to implement some form of state management in the form of a Stage. It's not perfect, but you can now have "conversations" with your bot in which you collect information and do something with it.

    ๐Ÿ‘€ You can see an example of a Stage in action in the stage bot example, which I've tried to document very well.

  • v0.18.1 Changes

    May 02, 2020
    • โž• Added ameba checks
    • Replaced Halite with HTTP::Client, resulting in a major speed boost
    • Rename persistent_init and persistent_cleanup to init and cleanup respectively
    • Remove handle_error in favor of Error.from_code
  • v0.18.0 Changes

    April 26, 2020

    Updated to bot API 4.8, including the support for the new darts animation

  • v0.17.0 Changes

    April 20, 2020

    โšก๏ธ This update includes a lot of good stuff. First and foremost are the improvements to building inline and reply keyboards. The old method was based heavily off of TelegrafJS and it worked, but the new way is much more "Crystally". Here's an example of it in action:

    keyboard = Tourmaline::ReplyKeyboardMarkup.build do button "Info" button "Visit Us"end
    

    โšก๏ธ also included in this update are changes to how persistence works. I wasn't a fan of how I was handling things before, but now I think things are much better. Prior to this update, Persistence was a module which was included in each persistence type which would then be included in the final client. Nothing wrong with this approach, but it did make it so that information could not be easily passed to the Persistence object.

    0๏ธโƒฃ Now Persistence is a class and Client will always have one. The default persistence is NilPersistence which does nothing. This can be easily swapped out for one of the other persistence types by passing the desired persistence object to the Client initializer.

    ๐Ÿ‘ I've also added DBPersistence which allows you to persist Users and Chats using a database rather than just a Hash or a JSON file. It uses the db shard on the backend and can be used with any of the supported adapters.

  • v0.16.0 Changes

    April 14, 2020
    • โž• Add CHANGELOG
    • โž• Add support for Filters.
    • โž• Add users methods to Update and Message to return all users included in the same.
    • ๐ŸŒฒ Replaced usage of the strange logger with the new Crystal Log class.
    • โšก๏ธ Log all updates with Debug severity if VERBOSE environment variable is set to true.
    • (breaking change) Renamed File to TFile to avoid conflicting with the builtin File class.
    • (breaking change) removed the Handler class and all subclasses. Update handling is now done exclusively with the EventHandler class and Filters.
  • v0.15.1 Changes

    April 10, 2020

    ๐Ÿš€ So I made a small mistake in an earlier revision which was causing On events to be fired by every event type, which was obviously a problem. This release fixes that.