event

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 14

Documentation

Overview

Package event 事件处理注册

Index

Constants

This section is empty.

Variables

DefaultHandlers 默认的 handler 结构,管理所有支持的 handler 类型

Functions

func ParseAndHandle

func ParseAndHandle(payload *dto.WSPayload) error

ParseAndHandle 处理回调事件

func ParseData

func ParseData(message []byte, target interface{}) error

ParseData 解析数据

func RegisterHandler added in v0.1.7

func RegisterHandler(opCode dto.OPCode, eventType dto.EventType, handler eventParseFunc)

RegisterHandler 注册回调事件处理器

func RegisterHandlers

func RegisterHandlers(handlers ...interface{}) dto.Intent

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 C2CFriendEventHandler added in v0.1.7

type C2CFriendEventHandler func(event *dto.WSPayload, data *dto.WSC2CFriendData) error

C2CFriendEventHandler C2C 好友事件 handler

type C2CMessageEventHandler added in v0.1.7

type C2CMessageEventHandler func(event *dto.WSPayload, data *dto.WSC2CMessageData) error

C2CMessageEventHandler 机器人消息事件 handler

type ChannelEventHandler

type ChannelEventHandler func(event *dto.WSPayload, data *dto.WSChannelData) error

ChannelEventHandler 子频道事件 handler

type DirectMessageDeleteEventHandler added in v0.1.1

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 EnterAIOEventHandler added in v0.1.7

type EnterAIOEventHandler func(event *dto.WSPayload, data *dto.WSEnterAIOData) error

EnterAIOEventHandler 进入AIO事件 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 GroupATMessageEventHandler added in v0.1.7

type GroupATMessageEventHandler func(event *dto.WSPayload, data *dto.WSGroupATMessageData) error

GroupATMessageEventHandler 群中at机器人消息事件 handler

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 added in v0.1.1

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

type PlainEventHandler func(event *dto.WSPayload, message []byte) error

PlainEventHandler 透传handler

type PostEventHandler

type PostEventHandler func(event *dto.WSPayload, data *dto.WSPostData) error

PostEventHandler 论坛回帖事件 handler

type PublicMessageDeleteEventHandler added in v0.1.1

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 SubscribeMsgStatusEventHandler added in v0.1.7

type SubscribeMsgStatusEventHandler func(event *dto.WSPayload, data *dto.WSSubscribeMsgStatus) error

SubscribeMsgStatusEventHandler 订阅消息模板授权状态变更事件 handler

type ThreadEventHandler

type ThreadEventHandler func(event *dto.WSPayload, data *dto.WSThreadData) error

ThreadEventHandler 论坛主题事件 handler

Jump to

Keyboard shortcuts

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