Add unit tests and abstract bot method execution framework
This commit is contained in:
parent
69f7ff6a5a
commit
7aa6be4e9a
3 changed files with 170 additions and 0 deletions
19
src/TgBotLib/Enums/Methods.php
Normal file
19
src/TgBotLib/Enums/Methods.php
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Enums;
|
||||
|
||||
use TgBotLib\Bot;
|
||||
use TgBotLib\Methods\GetMe;
|
||||
|
||||
enum Methods : string
|
||||
{
|
||||
case GET_ME = 'getMe';
|
||||
|
||||
public function execute(Bot $bot, array $parameters=[]): mixed
|
||||
{
|
||||
return match($this)
|
||||
{
|
||||
self::GET_ME => GetMe::execute($bot, $parameters),
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue