Telegram Bot SDK v0.9.0 Release Notes
Release Date: 2016-06-27 // almost 8 years ago-
Major changes:
Project ported to Swift 3.0 Snapshot 2016-06-20 (a). Xcode8 is required.
๐ Types and Requests (methods) are now generated automatically from Telegram docs by a Ruby script located in
API/
directory.๐ All types and requests are now supported.
Optional parameters added to request signatures. This code:
bot.sendMessage(chatId, "text", ["reply_markup": markup])
Can now be written as:
bot.sendMessage(chatId, "text", reply_markup: markup)
You can still pass an array with additional arguments at the end of parameters list if needed.
Other changes:
- ๐ Router now supports multiple comma separated paths:
router["List Items", "list"] = onListItems
0๏ธโฃ Router is now case insensitive by default.
๐ Multiword commands are now supported:
router["list add"] = onListAdd router["list remove"] = onListRemove
- ๐ Router chaining is now supported. Use
handler
method to use Router as a handler:
router1.unmatched = router2.handler
- To force the use of slash, instead of
slash: .required
option use:
router["command", .slashRequired] = handler
Multiple flags can be specified:
router["command", [.caseSensitive, .slashRequired]] = handler
context.args.command
is nowcontext.command
.๐ New variable:
context.slash
. True, if command was prefixed with a slash.router.unknownCommand
handler renamed torouter.unmatched
๐ Support
callback_query
in Router.JsonObject
protocol renamed toJsonConvertible
.Context.message
is now optional. Also, it fallbacks toedited_message
andcallback_query.message
when nil.Unknown command handler will no longer treat the first word as a command and will pass the entire string to a handler unchanged.
Context.command
will be empty.partialMatchHandler return value is now ignored. It can no longer cancel commands.
All types changed from classes to structs.
HTTP error codes except 401 (authentication error) are no longer fatal errors. TelegramBot will try to reconnect when encountering them.