-
-
Notifications
You must be signed in to change notification settings - Fork 0
Modules
Protocol Corporation edited this page Nov 20, 2024
·
10 revisions
- The namespace must be
ProtocolLive\StbModulesfor single bot; -
Must implements the interface
ProtocolLive\SimpleTelegramBot\StbInterfaces\StbModuleInterface - Must call function DebugTrace() in first line of every method;
- The file structure must be:
modules/MODULE_NAME/index.php - Global module must have an install and uninstall script in Composer
binfolder; (Example with TalkAs module);
public static function Command(
TelegramBotLibrary $Bot,
TblCmd $Webhook,
StbDatabase $Db,
StbLanguageSys $Lang
):void;That method are called when the user use a command.
public static function Cron(
TelegramBotLibrary $Bot,
StbDatabase $Db,
TblData $BotData
):void;Method used with cron jobs
public static function Install(
TelegramBotLibrary $Bot,
TgCallback $Webhook,
StbDatabase $Db,
StbLanguageSys $Lang
):void;That method are called by admin menu to install the module.
- Run
parent::InstallCmdbeforeparent::InstallHelper;
public static function Listener(
TelegramBotLibrary $Bot,
TgEventInterface $Webhook,
StbDatabase $Db,
StbLanguageSys $Lang
):void;That method are called when a event registered in datababase occurs.
public static function Uninstall(
TelegramBotLibrary $Bot,
TgCallback $Webhook,
StbDatabase $Db,
StbLanguageSys $Lang
):void;That method are called by admin menu to uninstall the module.
public static function Plugin_Buttons(
StbDatabase $Db,
TblMarkupInline $Markup
):void{Buttons to be added to admin module menu