-
- All Implemented Interfaces:
@Component() public final class ApiHandler
-
-
Constructor Summary
Constructors Constructor Description ApiHandler(BotProperties botProperties)
-
Method Summary
Modifier and Type Method Description final UnitonReceiveApiMessage(JSONObject message)收到 以前调用的API 的响应 final JSONObjectsendApiMessage(WebSocketSession botSession, IApiRequest apiRequest)发送自定义API final JSONObjectsendApiMessage(WebSocketSession botSession, ApiEnum action, JSONObject params)调用定义好的API -
-
Constructor Detail
-
ApiHandler
ApiHandler(BotProperties botProperties)
-
-
Method Detail
-
onReceiveApiMessage
final Unit onReceiveApiMessage(JSONObject message)
收到 以前调用的API 的响应
- Parameters:
message- 内容
-
sendApiMessage
final JSONObject sendApiMessage(WebSocketSession botSession, IApiRequest apiRequest)
发送自定义API
- Parameters:
botSession- websocketSessionapiRequest- 自定义请求
-
sendApiMessage
final JSONObject sendApiMessage(WebSocketSession botSession, ApiEnum action, JSONObject params)
调用定义好的API
- Parameters:
botSession- 机器人sessionaction- 执行的操作params- 参数
-
-
-
-