event

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: AGPL-3.0 Imports: 7 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FriendPokeEvent

type FriendPokeEvent struct {
	Sender   uint32
	Receiver uint32
	Suffix   string
	Action   string
}

FriendPokeEvent 好友戳一戳事件 from miraigo

func ParsePokeEvent

func ParsePokeEvent(event *message.GeneralGrayTipInfo) *FriendPokeEvent

func (*FriendPokeEvent) Content

func (g *FriendPokeEvent) Content() string

func (*FriendPokeEvent) From

func (g *FriendPokeEvent) From() uint32

type FriendRecall

type FriendRecall struct {
	FromUin  uint32
	FromUID  string
	Sequence uint64
	Time     uint32
	Random   uint32
}

func ParseFriendRecallEvent

func ParseFriendRecallEvent(event *message.FriendRecall) *FriendRecall

func (*FriendRecall) ResolveUin

func (fe *FriendRecall) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type GroupDigestEvent

type GroupDigestEvent struct {
	GroupEvent
	MessageID         uint32
	InternalMessageID uint32
	OperationType     uint32 // 1 -> 设置精华消息, 2 -> 移除精华消息
	OperateTime       uint32
	OperatorUin       uint32
	SenderNick        string
	OperatorNick      string
}

GroupDigestEvent 群精华消息 user为消息发送者 from miraigo

func ParseGroupDigestEvent

func ParseGroupDigestEvent(event *message.NotifyMessageBody) *GroupDigestEvent

func (*GroupDigestEvent) IsSet

func (g *GroupDigestEvent) IsSet() bool

type GroupEvent

type GroupEvent struct {
	GroupUin uint32
	// 触发事件的主体 详看各事件注释
	UserUin uint32
	UserUID string
}

GroupEvent 通用群事件

type GroupInvite

type GroupInvite struct {
	GroupUin    uint32
	GroupName   string
	InvitorUID  string
	InvitorUin  uint32
	InvitorNick string
	RequestSeq  uint64
}

func ParseInviteNotice

func ParseInviteNotice(event *message.GroupInvite) *GroupInvite

ParseInviteNotice 被邀请加群

func (*GroupInvite) ResolveUin

func (g *GroupInvite) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type GroupMemberDecrease

type GroupMemberDecrease struct {
	GroupEvent
	OperatorUID string
	OperatorUin uint32
	ExitType    uint32
}

GroupMemberDecrease 群成员减少事件 user为退群的成员

func ParseMemberDecreaseEvent

func ParseMemberDecreaseEvent(event *message.GroupChange) *GroupMemberDecrease

func (*GroupMemberDecrease) IsKicked

func (g *GroupMemberDecrease) IsKicked() bool

func (*GroupMemberDecrease) ResolveUin

func (g *GroupMemberDecrease) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type GroupMemberIncrease

type GroupMemberIncrease struct {
	GroupEvent
	InvitorUID string
	InvitorUin uint32
	JoinType   uint32
}

GroupMemberIncrease 群成员增加事件 user为新加群的成员

func ParseMemberIncreaseEvent

func ParseMemberIncreaseEvent(event *message.GroupChange) *GroupMemberIncrease

func (*GroupMemberIncrease) ResolveUin

func (g *GroupMemberIncrease) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type GroupMemberJoinRequest

type GroupMemberJoinRequest struct {
	GroupEvent
	TargetNick string
	InvitorUID string
	InvitorUin uint32
	Answer     string // 问题:(.*)答案:(.*)
	RequestSeq uint64
}

GroupMemberJoinRequest 加群请求 user为请求加群的成员

func ParseRequestInvitationNotice

func ParseRequestInvitationNotice(event *message.GroupInvitation) *GroupMemberJoinRequest

ParseRequestInvitationNotice 成员被邀请加群

func ParseRequestJoinNotice

func ParseRequestJoinNotice(event *message.GroupJoin) *GroupMemberJoinRequest

ParseRequestJoinNotice 成员主动加群

func (*GroupMemberJoinRequest) ResolveUin

func (g *GroupMemberJoinRequest) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type GroupMemberPermissionChanged

type GroupMemberPermissionChanged struct {
	GroupEvent
	IsAdmin bool
}

GroupMemberPermissionChanged 群成员权限变更

func ParseGroupMemberPermissionChanged

func ParseGroupMemberPermissionChanged(event *message.GroupAdmin) *GroupMemberPermissionChanged

func (*GroupMemberPermissionChanged) ResolveUin

func (g *GroupMemberPermissionChanged) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type GroupMute

type GroupMute struct {
	GroupEvent
	OperatorUID string // when TargetUID is empty, mute all members
	OperatorUin uint32
	Duration    uint32 // Duration == math.MaxUint32 when means mute all
}

GroupMute 群内禁言事件 user为被禁言的成员

func ParseGroupMuteEvent

func ParseGroupMuteEvent(event *message.GroupMute) *GroupMute

func (*GroupMute) MuteAll

func (g *GroupMute) MuteAll() bool

func (*GroupMute) ResolveUin

func (g *GroupMute) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type GroupNameUpdated

type GroupNameUpdated struct {
	GroupEvent
	NewName string
}

GroupNameUpdated 群名变更

func ParseGroupNameUpdatedEvent

func ParseGroupNameUpdatedEvent(event *message.NotifyMessageBody, groupName string) *GroupNameUpdated

func (*GroupNameUpdated) ResolveUin

func (g *GroupNameUpdated) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type GroupPokeEvent

type GroupPokeEvent struct {
	GroupEvent
	Receiver uint32
	Suffix   string
	Action   string
}

GroupPokeEvent 群戳一戳事件 user为发送者 from miraigo

func ParseGroupPokeEvent

func ParseGroupPokeEvent(event *message.NotifyMessageBody, groupUin uint32) *GroupPokeEvent

func (*GroupPokeEvent) Content

func (g *GroupPokeEvent) Content() string

func (*GroupPokeEvent) From

func (g *GroupPokeEvent) From() uint32

type GroupReactionEvent

type GroupReactionEvent struct {
	GroupEvent
	TargetSeq uint32
	IsAdd     bool
	IsEmoji   bool
	Code      string
	Count     uint32
}

GroupReactionEvent 群消息表态 user为发送表态的成员

func ParseGroupReactionEvent

func ParseGroupReactionEvent(event *message.GroupReaction) *GroupReactionEvent

func (*GroupReactionEvent) ResolveUin

func (g *GroupReactionEvent) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type GroupRecall

type GroupRecall struct {
	GroupEvent
	OperatorUID string
	OperatorUin uint32
	Sequence    uint64
	Time        uint32
	Random      uint32
}

GroupRecall 群内消息撤回 user为消息发送者

func ParseGroupRecallEvent

func ParseGroupRecallEvent(event *message.NotifyMessageBody) *GroupRecall

func (*GroupRecall) ResolveUin

func (g *GroupRecall) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type INotifyEvent

type INotifyEvent interface {
	From() uint32
	Content() string
}

type Iuid2uin added in v0.1.2

type Iuid2uin interface {
	ResolveUin(func(uid string, groupUin ...uint32) uint32)
}

Iuid2uin uid转uin

type JSONParam added in v0.1.1

type JSONParam struct {
	Cmd  int    `json:"cmd"`
	Data string `json:"data"`
	Text string `json:"text"`
	URL  string `json:"url"`
}

type MemberSpecialTitleUpdated

type MemberSpecialTitleUpdated struct {
	GroupEvent
	NewTitle string
}

MemberSpecialTitleUpdated 群成员头衔更新事件 from miraigo

func ParseGroupMemberSpecialTitleUpdatedEvent

func ParseGroupMemberSpecialTitleUpdatedEvent(event *message.GroupSpecialTitle, groupUin uint32) *MemberSpecialTitleUpdated

type NewFriend added in v0.1.3

type NewFriend struct {
	FromUin  uint32
	FromUID  string
	FromNick string
	Msg      string
}

func ParseNewFriendEvent added in v0.1.3

func ParseNewFriendEvent(event *message.NewFriend) *NewFriend

func (*NewFriend) ResolveUin added in v0.1.3

func (fe *NewFriend) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

type NewFriendRequest

type NewFriendRequest struct {
	SourceUin  uint32
	SourceUID  string
	SourceNick string
	Msg        string
	Source     string
}

func ParseFriendRequestNotice

func ParseFriendRequestNotice(event *message.FriendRequest) *NewFriendRequest

type Rename

type Rename struct {
	SubType  uint32 // self 0 friend 1
	Uin      uint32
	UID      string
	Nickname string
}

func ParseFriendRenameEvent

func ParseFriendRenameEvent(event *message.FriendRenameMsg) *Rename

func ParseSelfRenameEvent

func ParseSelfRenameEvent(event *message.SelfRenameMsg, sig *auth.SigInfo) *Rename

func (*Rename) ResolveUin

func (fe *Rename) ResolveUin(f func(uid string, groupUin ...uint32) uint32)

Jump to

Keyboard shortcuts

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