Documentation ¶
Index ¶
- Variables
- func ParseAndHandle(payload *dto.WSPayload) error
- func ParseData(message []byte, target interface{}) error
- func RegisterHandlers(handlers ...interface{}) dto.Intent
- type ATMessageEventHandler
- type AudioEventHandler
- type C2CMessageEventHandler
- type C2CMsgReceiveHandle
- type C2CMsgRejectHandle
- type ChannelEventHandler
- type DirectMessageDeleteEventHandler
- type DirectMessageEventHandler
- type ErrorNotifyHandler
- type ForumAuditEventHandler
- type FriendAddEventHandle
- type FriendDelEventHandle
- type GroupAddRobotEventHandle
- type GroupAtMessageEventHandler
- type GroupDelRobotEventHandle
- type GroupMessageEventHandler
- type GroupMsgReceiveEventHandle
- type GroupMsgRejectEventHandle
- type GuildEventHandler
- type GuildMemberEventHandler
- type InteractionEventHandler
- type MessageAuditEventHandler
- type MessageDeleteEventHandler
- type MessageEventHandler
- type MessageReactionEventHandler
- type PlainEventHandler
- type PostEventHandler
- type PublicMessageDeleteEventHandler
- type ReadyHandler
- type ReplyEventHandler
- type ThreadEventHandler
Constants ¶
This section is empty.
Variables ¶
var DefaultHandlers struct { Ready ReadyHandler ErrorNotify ErrorNotifyHandler Plain PlainEventHandler Guild GuildEventHandler GuildMember GuildMemberEventHandler Channel ChannelEventHandler Message MessageEventHandler MessageReaction MessageReactionEventHandler ATMessage ATMessageEventHandler DirectMessage DirectMessageEventHandler MessageAudit MessageAuditEventHandler MessageDelete MessageDeleteEventHandler PublicMessageDelete PublicMessageDeleteEventHandler DirectMessageDelete DirectMessageDeleteEventHandler Audio AudioEventHandler Thread ThreadEventHandler Post PostEventHandler Reply ReplyEventHandler ForumAudit ForumAuditEventHandler Interaction InteractionEventHandler GroupAtMessage GroupAtMessageEventHandler GroupMessage GroupMessageEventHandler C2CMessage C2CMessageEventHandler GroupAddRobot GroupAddRobotEventHandle GroupDelRobot GroupDelRobotEventHandle GroupMsgReject GroupMsgRejectEventHandle GroupMsgReceive GroupMsgReceiveEventHandle FriendAdd FriendAddEventHandle FriendDel FriendDelEventHandle C2CMsgReject C2CMsgRejectHandle C2CMsgReceive C2CMsgReceiveHandle }
DefaultHandlers 默认的 handler 结构,管理所有支持的 handler 类型
Functions ¶
func RegisterHandlers ¶
RegisterHandlers 注册事件回调,并返回 intent 用于 websocket 的鉴权
Types ¶
type ATMessageEventHandler ¶
type ATMessageEventHandler func(event *dto.WSPayload, data *dto.WSATMessageData) error
ATMessageEventHandler at 机器人消息事件 handler
type AudioEventHandler ¶
type AudioEventHandler func(event *dto.WSPayload, data *dto.WSAudioData) error
AudioEventHandler 音频机器人事件 handler
type C2CMessageEventHandler ¶
type C2CMessageEventHandler func(event *dto.WSPayload, data *dto.WSC2CMessageData) error
type C2CMsgReceiveHandle ¶
type C2CMsgReceiveHandle func(event *dto.WSPayload, data *dto.WSFriendMsgReveiceData) error
type C2CMsgRejectHandle ¶
type C2CMsgRejectHandle func(event *dto.WSPayload, data *dto.WSFriendMsgRejectData) error
type ChannelEventHandler ¶
type ChannelEventHandler func(event *dto.WSPayload, data *dto.WSChannelData) error
ChannelEventHandler 子频道事件 handler
type DirectMessageDeleteEventHandler ¶
type DirectMessageDeleteEventHandler func(event *dto.WSPayload, data *dto.WSDirectMessageDeleteData) error
DirectMessageDeleteEventHandler 消息事件 handler
type DirectMessageEventHandler ¶
type DirectMessageEventHandler func(event *dto.WSPayload, data *dto.WSDirectMessageData) error
DirectMessageEventHandler 私信消息事件 handler
type ErrorNotifyHandler ¶
type ErrorNotifyHandler func(err error)
ErrorNotifyHandler 当 ws 连接发生错误的时候,会回调,方便使用方监控相关错误 比如 reconnect invalidSession 等错误,错误可以转换为 bot.Err
type ForumAuditEventHandler ¶
type ForumAuditEventHandler func(event *dto.WSPayload, data *dto.WSForumAuditData) error
ForumAuditEventHandler 论坛帖子审核事件 handler
type FriendAddEventHandle ¶
type FriendAddEventHandle func(event *dto.WSPayload, data *dto.WSFriendAddData) error
type FriendDelEventHandle ¶
type FriendDelEventHandle func(event *dto.WSPayload, data *dto.WSFriendDelData) error
type GroupAddRobotEventHandle ¶
type GroupAddRobotEventHandle func(event *dto.WSPayload, data *dto.WSGroupAddRobotData) error
type GroupAtMessageEventHandler ¶
type GroupAtMessageEventHandler func(event *dto.WSPayload, data *dto.WSGroupATMessageData) error
type GroupDelRobotEventHandle ¶
type GroupDelRobotEventHandle func(event *dto.WSPayload, data *dto.WSGroupDelRobotData) error
type GroupMessageEventHandler ¶
type GroupMessageEventHandler func(event *dto.WSPayload, data *dto.WSGroupMessageData) error
type GroupMsgReceiveEventHandle ¶
type GroupMsgReceiveEventHandle func(event *dto.WSPayload, data *dto.WSGroupMsgReceiveData) error
type GroupMsgRejectEventHandle ¶
type GroupMsgRejectEventHandle func(event *dto.WSPayload, data *dto.WSGroupMsgRejectData) error
type GuildEventHandler ¶
type GuildEventHandler func(event *dto.WSPayload, data *dto.WSGuildData) error
GuildEventHandler 频道事件handler
type GuildMemberEventHandler ¶
type GuildMemberEventHandler func(event *dto.WSPayload, data *dto.WSGuildMemberData) error
GuildMemberEventHandler 频道成员事件 handler
type InteractionEventHandler ¶
type InteractionEventHandler func(event *dto.WSPayload, data *dto.WSInteractionData) error
InteractionEventHandler 互动事件 handler
type MessageAuditEventHandler ¶
type MessageAuditEventHandler func(event *dto.WSPayload, data *dto.WSMessageAuditData) error
MessageAuditEventHandler 消息审核事件 handler
type MessageDeleteEventHandler ¶
type MessageDeleteEventHandler func(event *dto.WSPayload, data *dto.WSMessageDeleteData) error
MessageDeleteEventHandler 消息事件 handler
type MessageEventHandler ¶
type MessageEventHandler func(event *dto.WSPayload, data *dto.WSMessageData) error
MessageEventHandler 消息事件 handler
type MessageReactionEventHandler ¶
type MessageReactionEventHandler func(event *dto.WSPayload, data *dto.WSMessageReactionData) error
MessageReactionEventHandler 表情表态事件 handler
type PlainEventHandler ¶
PlainEventHandler 透传handler
type PostEventHandler ¶
type PostEventHandler func(event *dto.WSPayload, data *dto.WSPostData) error
PostEventHandler 论坛回帖事件 handler
type PublicMessageDeleteEventHandler ¶
type PublicMessageDeleteEventHandler func(event *dto.WSPayload, data *dto.WSPublicMessageDeleteData) error
PublicMessageDeleteEventHandler 消息事件 handler
type ReadyHandler ¶
type ReadyHandler func(event *dto.WSPayload, data *dto.WSReadyData)
ReadyHandler 可以处理 ws 的 ready 事件
type ReplyEventHandler ¶
type ReplyEventHandler func(event *dto.WSPayload, data *dto.WSReplyData) error
ReplyEventHandler 论坛帖子回复事件 handler
type ThreadEventHandler ¶
type ThreadEventHandler func(event *dto.WSPayload, data *dto.WSThreadData) error
ThreadEventHandler 论坛主题事件 handler