event

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Id        int64                    `json:"id"`                 //事件 ID
	Type      string                   `json:"type"`               //事件类型
	Platform  string                   `json:"platform"`           //接收者的平台名称
	SelfId    string                   `json:"self_id"`            //接收者的平台账号
	Timestamp int64                    `json:"timestamp"`          //事件的时间戳
	Channel   *channel.Channel         `json:"channel,omitempty"`  //事件所属的频道
	Guild     *guild.Guild             `json:"guild,omitempty"`    //事件所属的群组
	Login     *login.Login             `json:"login,omitempty"`    //事件的登录信息
	Member    *guildmember.GuildMember `json:"member,omitempty"`   //事件的目标成员
	Message   *message.Message         `json:"message,omitempty"`  //事件的消息
	Operator  *user.User               `json:"operator,omitempty"` //事件的操作者
	Role      *guildrole.GuildRole     `json:"role,omitempty"`     //事件的目标角色
	User      *user.User               `json:"user,omitempty"`     //事件的目标用户
}

type EventHandler

type EventHandler struct {
	EventType    string
	EventHandler EventHandlerCallback
}

type EventHandlerCallback

type EventHandlerCallback func(e Event) error

type EventInterface

type EventInterface interface {
	// contains filtered or unexported methods
}

type SatoriChannelEvent

type SatoriChannelEvent interface {
	EventInterface
}

func NewSatoriChannelEvent

func NewSatoriChannelEvent() (SatoriChannelEvent, error)

type SatoriEventImpl

func (*SatoriEventImpl) StartWithCtx

func (s *SatoriEventImpl) StartWithCtx(ctx context.Context) error

type SatoriGuildEvent

type SatoriGuildEvent interface {
	EventInterface
	ListenGuildAdded(callback EventHandlerCallback)
	ListenGuildUpdated(callback EventHandlerCallback)
	ListenGuildRemoved(callback EventHandlerCallback)
	ListenGuildRequest(callback EventHandlerCallback)
}

func NewSatoriGuildEvent

func NewSatoriGuildEvent() (SatoriGuildEvent, error)

type SatoriGuildMemberEvent

type SatoriGuildMemberEvent interface {
	EventInterface
	ListenGuildMemberAdded(callback EventHandlerCallback)
	ListenGuildMemberUpdated(callback EventHandlerCallback)
	ListenGuildMemberRemoved(callback EventHandlerCallback)
	ListenGuildMemberRequest(callback EventHandlerCallback)
}

func NewSatoriGuildMemberEvent

func NewSatoriGuildMemberEvent() (SatoriGuildMemberEvent, error)

type SatoriGuildRoleEvent

type SatoriGuildRoleEvent interface {
	EventInterface
	ListenGuildRoleCreated(callback EventHandlerCallback)
	ListenGuildRoleUpdated(callback EventHandlerCallback)
	ListenGuildRoleDeleted(callback EventHandlerCallback)
}

func NewSatoriGuildRoleEvent

func NewSatoriGuildRoleEvent() (SatoriGuildRoleEvent, error)

type SatoriLoginEvent

type SatoriLoginEvent interface {
	EventInterface
	ListenLoginAdded(callback EventHandlerCallback)
	ListenLoginUpdated(callback EventHandlerCallback)
	ListenLoginRemoved(callback EventHandlerCallback)
}

func NewSatoriLoginEvent

func NewSatoriLoginEvent() (SatoriLoginEvent, error)

type SatoriMessageEvent

type SatoriMessageEvent interface {
	EventInterface
	ListenMessageCreated(callback EventHandlerCallback)
	ListenMessageUpdated(callback EventHandlerCallback)
	ListenMessageDelete(callback EventHandlerCallback)
}

func NewSatoriMessageEvent

func NewSatoriMessageEvent() (SatoriMessageEvent, error)

type SatoriReactionEvent

type SatoriReactionEvent interface {
	EventInterface
	ListenReactionAdded(callback EventHandlerCallback)
	ListenReactionRemoved(callback EventHandlerCallback)
}

func NewSatoriReactionEvent

func NewSatoriReactionEvent() (SatoriReactionEvent, error)

type SatoriUserEvent

type SatoriUserEvent interface {
	EventInterface
	ListenFriendRequest(callback EventHandlerCallback)
}

func NewSatoriUserEvent

func NewSatoriUserEvent() (SatoriUserEvent, error)

type SignInfo

type SignInfo struct {
	Op   uint64      `json:"op"`
	Body interface{} `json:"body,omitempty"`
}

Jump to

Keyboard shortcuts

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