event

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 3 Imported by: 14

Documentation

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 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 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 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 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 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