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
, andBotCommandScope
. - Added
scope
andlanguage_code
options toset_my_commands
andget_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 toClient.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 ofUpdateAction
, or a single one. - ๐ Fixed an issue where
poll
always deletes a set webhook. Now it will only delete the webhook ifdelete_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 withinEventHandlers::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 aself.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, includingCommandHandler
,HearsHandler
,CallbackQueryHandler
,ChosenInlineResultHandler
,InlineQueryHandler
, and the standardUpdateHandler
. 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 withInt::Primitive
- ๐ Make
Helpers.random_string
actually return a random string, not just a number - ๐ Change the first run logic in
Stage
- Replace broken
-
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. TheClient
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
andpersistent_cleanup
toinit
andcleanup
respectively - Remove
handle_error
in favor ofError.from_code
-
v0.18.0 Changes
April 26, 2020Updated 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 thePersistence
object.0๏ธโฃ Now
Persistence
is a class andClient
will always have one. The default persistence isNilPersistence
which does nothing. This can be easily swapped out for one of the other persistence types by passing the desired persistence object to theClient
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 toUpdate
andMessage
to return all users included in the same. - ๐ฒ Replaced usage of the
strange
logger with the new CrystalLog
class. - โก๏ธ Log all updates with
Debug
severity ifVERBOSE
environment variable is set totrue
. - (breaking change) Renamed
File
toTFile
to avoid conflicting with the builtinFile
class. - (breaking change) removed the
Handler
class and all subclasses. Update handling is now done exclusively with theEventHandler
class andFilter
s.
-
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.