bot

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBot

func NewBot(bot_id, bot_secret, path, addr string) *bot

NewBot 创建一个机器人实例,bot_id 为机器人的id,bot_secret 为机器人的secret,path 为接收事件的路径(如"/"),addr 为接收事件的地址(如":8888"); 机器人实例创建后,需要调用 Run() 方法启动机器人; 对于消息处理,可以通过 AddPreprocessor() 方法添加预处理器,通过 AddOnCommand() 方法添加命令处理器,通过 AddListener() 方法添加事件监听器; 对于插件,可以通过 AddPlugin() 方法添加插件; 整体消息处理的运行与短路顺序为: [main]预处理器 -> [插件]预处理器 -> [插件]令处理器 -> [main]命令处理器 -> [main]事件监听器;

func StartAllBot

func StartAllBot()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL