rapierorg / telegram-bot-swift

Telegram Bot SDK for Swift (unofficial)
https://github.com/rapierorg/telegram-bot-swift/wiki
Apache License 2.0
375 stars 63 forks source link

Allow commands to start with different symbol #53

Open zmeyc opened 6 years ago

zmeyc commented 6 years ago
- router["command"] : allow both "/command" and "command": typical usage
- router["command", .exactMatch]: allow only "command": rare case
- router [".command"]:  allow only ".command": special command sets
- router["/command"]: allow only "/command": rare case

In other words, the logic is: if it starts with alphanumeric, then '/' is optional, otherwise requires exact match.