Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Modules
Protocol Corporation edited this page Nov 26, 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);
- There is a parent class called
ProtocolLive\SimpleTelegramBot\StbObjects\StbModuleHelperwith helpers;
publicstaticfunction Command(
TelegramBotLibrary$Bot,
TblCmd$Webhook,
StbDatabase$Db,
StbLanguageSys$Lang
):void;That method are called when the user use a command.
publicstaticfunction Cron(
TelegramBotLibrary$Bot,
StbDatabase$Db,
TblData$BotData
):void;Method used with cron jobs
publicstaticfunction 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;
publicstaticfunction Listener(
TelegramBotLibrary$Bot,
TgEventInterface$Webhook,
StbDatabase$Db,
StbLanguageSys$Lang
):void;That method are called when a event registered in datababase occurs.
publicstaticfunction Uninstall(
TelegramBotLibrary$Bot,
TgCallback$Webhook,
StbDatabase$Db,
StbLanguageSys$Lang
):void;That method are called by admin menu to uninstall the module.
See session Plugin - Buttons