Releases: Mateodioev/telegram-bot-handler
Releases · Mateodioev/telegram-bot-handler
Add middleware params
Full Changelog: v5.7.3...v5.8.0
Add temporary conversations
- Delete method handle
- Add ttl to conversation
Not compatible with release v5.1
Full Changelog: v5.1...v5.4-beta
Use stable release of mateodiev/tgbot
- Add methods
EventInterface::api
andEventInterface::ctx
- Deprecated method handle in commands
- Add exception
Mateodioev\TgHandler\BotException
as base exception - Incompatible with v5.0.1
Full Changelog: v5.0.1...v5.1
Add event filters
Now you can use custom filters for you events as attributes
Full Changelog: v3.5.0...v4.1.1
Add support for params in commands
Now you can format you commands with regex pattern
Example:
use Mateodioev\Bots\Telegram\Api;
use Mateodioev\TgHandler\Context;
use Mateodioev\TgHandler\Commands\MessageCommand;
class Start extends MessageCommand {
protected string $name = 'info';
protected string $params = '{w:id}';
public function handle(Api $bot, Context $context, array $args = []) {
$id = $this->param('id', 'default id'); // get the param
}
}
// This command now only works with this format: "/info myId"
Full Changelog: v3.4.04...v3.5.0
Fixed regex on commands event
change .
for [\s\S]
in regex builder
Full Changelog: v3.4.04...v3.4.05
Minor changes
Implementations of isValid method has been simplefied
Full Changelog: v3.4.03...v3.4.04
Minor changes
Full Changelog: v3.4.02...v3.4.03
Add All event
If you want to receive all event types with a single event handler you can use Mateodioev\TgHandler\Events\Types\AllEvent
use Mateodioev\TgHandler\Events\Types\AllEvent;
use Mateodioev\Bots\Telegram\Api;
use Mateodioev\TgHandler\Context;
class AllHandler extends AllEvent
{
public function execute(Api $bot, Context $context, array $args = [])
{
// Put your logic here
}
}
// Register event
$bot->onEvent(new AllHandler);
See more in examples/All.php
Full Changelog: v3.4.0...v3.4.02
Update logger
Now you can use logger levels
Full Changelog: v3.3.1...v3.4.0