message

package
Version: v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventReceiveFriendMessage            = "FriendMessage"
	EventReceiveGroupMessage             = "GroupMessage"
	EventReceiveTempMessage              = "TempMessage"
	EventBotOnline                       = "BotOnlineEvent"
	EventBotOfflineActive                = "BotOfflineEventActive"
	EventBotOfflineForce                 = "BotOfflineEventForce"
	EventBotOfflineDropped               = "BotOfflineEventDropped"
	EventBotRelogin                      = "BotReloginEvent"
	EventGroupRecall                     = "GroupRecallEvent"
	EventFriendRecall                    = "FriendRecallEvent"
	EventBotGroupPermissionChange        = "BotGroupPermissionChangeEvent"
	EventBotMute                         = "BotMuteEvent"
	EventBotUnmute                       = "BotUnmuteEvent"
	EventBotJoinGroup                    = "BotJoinGroupEvent"
	EventBotLeaveActive                  = "BotLeaveEventActive"
	EventBotLeaveKick                    = "BotLeaveEventKick"
	EventGroupNameChange                 = "GroupNameChangeEvent"
	EventGroupEntranceAnnouncementChange = "GroupEntranceAnnouncementChangeEvent"
	EventGroupMuteAll                    = "GroupMuteAllEvent"
	EventGroupAllowAnonymousChat         = "GroupAllowAnonymousChatEvent"
	EventGroupAllowConfessTalk           = "GroupAllowConfessTalkEvent"
	EventGroupAllowMemberInvite          = "GroupAllowMemberInviteEvent"
	EventMemberJoin                      = "MemberJoinEvent"
	EventMemberLeaveKick                 = "MemberLeaveEventKick"
	EventMemberLeaveQuit                 = "MemberLeaveEventQuit"
	EventMemberCardChange                = "MemberCardChangeEvent"
	EventMemberSpecialTitleChange        = "MemberSpecialTitleChangeEvent"
	EventMemberPermissionChange          = "MemberPermissionChangeEvent"
	EventMemberMute                      = "MemberMuteEvent"
	EventMemberUnmute                    = "MemberUnmuteEvent"
	EventNewFriendRequest                = "NewFriendRequestEvent"
	EventMemberJoinRequest               = "MemberJoinRequestEvent"
	EventBotInvitedJoinGroupRequest      = "BotInvitedJoinGroupRequestEvent"
)
View Source
const (
	MsgType_Source     = "Source"
	MsgType_Quote      = "Quote"
	MsgType_At         = "At"
	MsgType_AtAll      = "AtAll"
	MsgType_Face       = "Face"
	MsgType_Plain      = "Plain"
	MsgType_Image      = "Image"
	MsgType_FlashImage = "FlashImage"
	MsgType_Voice      = "Voice"
	MsgType_Xml        = "Xml"
	MsgType_Json       = "Json"
	MsgType_App        = "App"
	MsgType_Poke       = "Poke"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	Msg []Message
}

func GenChain

func GenChain(args ...Message) Chain

type Event

type Event struct {
	Type         string    `json:"type"`         //事件类型
	MessageChain []Message `json:"messageChain"` //(ReceiveMessage)消息链
	Sender       Sender    `json:"sender"`       //(ReceiveMessage)发送者信息
	EventId      uint      `json:"eventId"`      //事件ID
	FromId       uint      `json:"fromId"`       //操作人
	GroupId      uint      `json:"groupId"`      //群号

	Member  MemberData `json:"member,omitempty"`
	Message string     `json:"message,omitempty"` // 入群申请消息
}

type Friend

type Friend struct {
	Id       uint   `json:"id,omitempty"`         //QQ
	NickName string `json:"memberName,omitempty"` //昵称
	Remark   string `json:"remark,omitempty"`     //备注
}

type Group

type Group struct {
	Id        uint   `json:"id,omitempty"`        //消息来源群号
	Name      string `json:"name,omitempty"`      //消息来源群名
	Permisson string `json:"permisson,omitempty"` //bot在群中的角色
}

type GroupConfig

type GroupConfig struct {
	Name              string
	Announcement      string
	ConfessTalk       bool
	AllowMemberInvite bool
	AutoApprove       bool
	AnonymousChat     bool
}

type MemberData added in v1.1.0

type MemberData struct {
	ID         int
	MemberName string
	Permission string
	Group      struct {
		ID         int
		Name       string
		Permission string
	}
}

type MemberInfo

type MemberInfo struct {
	Name         string
	SpecialTitle string
}

type Message

type Message struct {
	Type     string    `json:"type,omitempty"`
	Id       uint      `json:"id,omitempty"`       //(Source,Quote)Source中表示消息id,Quote中表示被引用回复的原消息的id
	Time     int64     `json:"time,omitempty"`     //(Source) 发送时间
	GroupId  uint      `json:"groupId,omitempty"`  //(Quote)Quote中表示被引用回复的原消息的群号
	SenderId uint      `json:"senderId,omitempty"` //(Quote)Quote中表示被引用回复的原消息的发送者QQ号
	TargetId uint      `json:"targetId,omitempty"` //(Quote)Quote中表示被引用回复的原消息的接收者群号或QQ号
	Origin   []Message `json:"origin,omitempty"`   //(Quote)Quote中表示被引用回复的原消息的消息链对象
	Target   uint      `json:"target,omitempty"`   //(At)@的群员QQ号
	Display  string    `json:"display,omitempty"`  //(At)@的显示文本
	FaceId   int       `json:"faceId,omitempty"`   //(Face)QQ表情的ID,发送时优先级比Name高
	Name     string    `json:"name,omitempty"`     //(Face,Poke)Face中为QQ表情的拼音,Poke中为戳一戳的类型
	Text     string    `json:"text,omitempty"`     //(Plain)纯文本
	ImageId  string    `json:"imageId,omitempty"`  //(Image,FlashImage)图片ID,注意消息类型,群图片和好友图片格式不一样,发送时优先级比ImageUrl高
	VoiceId  string    `json:"voiceId,omitempty"`
	URL      string    `json:"url,omitempty"`     //(Image,FlashImage)图片url,发送时可使用网络图片的链接,优先级比ImagePath高;接收时为腾讯图片服务器的链接
	Path     string    `json:"path,omitempty"`    //(Image,FlashImage)图片的路径,发送本地图片,相对路径于plugins/MiraiAPIHTTP/images
	Xml      string    `json:"xml,omitempty"`     //(Xml) xml消息本体
	Json     string    `json:"json,omitempty"`    //(Json) json消息本体
	Content  string    `json:"content,omitempty"` //(App) 不知道干嘛的,mirai也没有说明,估计是小程序连接?

}

func AtMessage

func AtMessage(target uint) Message

func FaceMessage

func FaceMessage(faceID int) Message

func FlashImageMessage

func FlashImageMessage(t, v string) Message

func ImageMessage

func ImageMessage(t, v string) Message

func PlainMessage

func PlainMessage(text string) Message

func PokeMessage

func PokeMessage(name string) Message

func RichMessage

func RichMessage(t, content string) Message

func VoiceMessage added in v1.1.0

func VoiceMessage(t, v string) Message

type Sender

type Sender struct {
	Friend
	MemberName string `json:"memberName,omitempty"` //(GroupMessage)发送者群昵称
	Permission string `json:"permission,omitempty"` //(GroupMessage)发送者在群中的角色
	Group      Group  `json:"group,omitempty"`      //(GroupMessage)消息来源群信息
}

Jump to

Keyboard shortcuts

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