Telegram Bot SDK v0.10.0 Release Notes
Release Date: 2016-07-03 // almost 8 years ago-
โ Added
Examples/shopster-bot
: a sample bot which maintains a shopping list using sqlite3 database. GRDB library is used for working with database. This bot allows creating shared shopping lists in group chats.๐ Callback query data used in InlineButtons can now be parsed similarly to plaintext commands using arguments scanner. Simply call
context.args.scanWord()
to fetch a word from callback data and so on.Router path
.callback_query
now accepts nil:callback_query(data: nil)
. Pass nil to match any data, then parse it in handler using arguments scanner.๐ Router now supports context-sensitive user properties. Pass them to
process
method:
var properties = [String: AnyObject]() properties["myField"] = myValue try router.process(update: update, properties: properties)
And use them in handlers:
func myHandler(context: Context) -> Bool { let myValue = context.properties["myField"] as? MyValueType // ... }
Or make a
Context
category for easier access to your properties, for example:extension Context { var session: Session { return properties["session"] as! Session } }
โ Added
scanInt64()
to arguments scanner.readToken("filename or env var")
is nowreadToken(from: "filename or env var")