Zhamao Framework 3.2.4
A high-performance chatbot + web framework
载入中...
搜索中...
未找到
ZM\Plugin\Traits 命名空间参考

函数

 onBotAction (BotAction $bot_action_annotation)
 
 getBotActions ()
 
 addBotCommand (BotCommand $command)
 
 getBotCommands ()
 
 addBotEvent (BotEvent $event)
 
 getBotEvents ()
 
 addCron (Cron $cron)
 
 getCrons ()
 
 addEvent (string $event_name, callable $callback, int $level=20)
 
 getEvents ()
 
 onInit (callable $callback, int $worker_id=0, int $level=20)
 
 getInits ()
 
 onPluginLoad (callable $callback)
 
 emitPluginLoad (AnnotationParser $parser)
 
 onPack (callable $callback)
 
 filterPack (callable $callback)
 
 emitPack ()
 
 emitFilterPack (string $file)
 
 addHttpRoute (Route $route)
 
 getRoutes ()
 
 addTimerTick (int $ms, callable $callback, int $worker_id=0)
 
 getTimerTicks ()
 

变量

trait BotActionTrait
 
trait BotCommandTrait
 
trait BotEventTrait
 
trait CronTrait
 
trait EventTrait
 
trait InitTrait
 
trait PluginLoadTrait
 
trait PluginPackTrait
 
mixed $on_pack_filter = null
 
trait RouteTrait
 
trait TickTrait
 

函数说明

◆ addBotCommand()

addBotCommand ( BotCommand  $command)

添加一个 OneBot 机器人命令

参数
BotCommand$commandBotCommand 注解对象

◆ addBotEvent()

addBotEvent ( BotEvent  $event)

添加一个 OneBot 机器人事件

参数
BotEvent$eventBotEvent 注解对象

◆ addCron()

addCron ( Cron  $cron)

添加一个计划任务

参数
Cron$cron计划任务注解对象

◆ addEvent()

addEvent ( string  $event_name,
callable  $callback,
int  $level = 20 
)

添加一个框架底层的事件

◆ addHttpRoute()

addHttpRoute ( Route  $route)

添加一个 HTTP 路由

参数
Route$routeRoute 注解对象

◆ addTimerTick()

addTimerTick ( int  $ms,
callable  $callback,
int  $worker_id = 0 
)

◆ emitFilterPack()

emitFilterPack ( string  $file)

◆ emitPack()

emitPack ( )

◆ emitPluginLoad()

emitPluginLoad ( AnnotationParser  $parser)

调用插件加载前回调(需要在解析插件的注解时调用,并传入注解解析器)

参数
AnnotationParser$parser注解解析器

◆ filterPack()

filterPack ( callable  $callback)

◆ getBotActions()

getBotActions ( )

◆ getBotCommands()

getBotCommands ( )

◆ getBotEvents()

getBotEvents ( )

◆ getCrons()

getCrons ( )

◆ getEvents()

getEvents ( )

◆ getInits()

getInits ( )

获取初始化注解事件回调

◆ getRoutes()

getRoutes ( )

◆ getTimerTicks()

getTimerTicks ( )

◆ onBotAction()

onBotAction ( BotAction  $bot_action_annotation)

◆ onInit()

onInit ( callable  $callback,
int  $worker_id = 0,
int  $level = 20 
)

设置当前插件的加载后的初始化回调

参数
callable$callback回调函数
int$worker_id所在的 Worker 进程,默认在 #0
int$level优先级

◆ onPack()

onPack ( callable  $callback)

设置插件被打包前执行的回调函数

参数
callable$callback回调函数

◆ onPluginLoad()

onPluginLoad ( callable  $callback)

设置当前插件的插件加载前回调

参数
callable$callback回调函数

变量说明

◆ $on_pack_filter

mixed $on_pack_filter = null
protected

◆ BotActionTrait

trait BotActionTrait
初始值:
{
protected array $bot_actions = []

◆ BotCommandTrait

trait BotCommandTrait
初始值:
{
protected array $bot_commands = []

◆ BotEventTrait

trait BotEventTrait
初始值:
{
protected array $bot_events = []

◆ CronTrait

trait CronTrait
初始值:
{
protected array $crons = []

◆ EventTrait

trait EventTrait
初始值:
{
protected array $events = []

◆ InitTrait

trait InitTrait
初始值:
{
protected array $on_init = []

◆ PluginLoadTrait

trait PluginLoadTrait
初始值:
{
protected mixed $on_plugin_load = null

◆ PluginPackTrait

trait PluginPackTrait
初始值:
{
protected mixed $on_pack = null

◆ RouteTrait

trait RouteTrait
初始值:
{
protected array $routes = []

◆ TickTrait

trait TickTrait
初始值:
{
protected array $ticks = []