onebotv11

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

README

You are creating a public repository in the gonebot-dev organization.

goneadapter-onebotv11

OneBot v11 adapter for gonebot.

Gonebot Adapter for onebot v11.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OneBotV11 adapter.Adapter

The adapter for "OneBot v11"

This requires a NTQQ protocol application running aside, like Lagrange.OneBot

And the reverse socket server should be started on 127.0.0.1:21390(ONEBOTV11_HOST in .env file) by default.

You can override the host address to your liking by setting ONEBOTV11_HOST in .env file.

And you should be aware that the host is your gonebot server, not any NTQQ protocol

Functions

This section is empty.

Types

type ActionPayload

type ActionPayload struct {
	Action string `json:"action"`
	Params any    `json:"params"`
}

type AdminChange

type AdminChange struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "group_admin"
	NoticeType string `json:"notice_type"`
	// "set" or "unset"
	SubType string `json:"sub_type"`
	GroupID int64  `json:"group_id"`
	// Victim ID
	UserID int64 `json:"user_id"`
}

func (AdminChange) AdapterName

func (adminChange AdminChange) AdapterName() string

func (AdminChange) ToRawText

func (adminChanage AdminChange) ToRawText(msg message.MessageSegment) string

func (AdminChange) TypeName

func (adminChange AdminChange) TypeName() string

type AtType

type AtType struct {
	message.MessageType
	QQ string `json:"qq"`
}

func (AtType) AdapterName

func (serializer AtType) AdapterName() string

func (AtType) ToRawText

func (at AtType) ToRawText(msg message.MessageSegment) string

func (AtType) TypeName

func (serializer AtType) TypeName() string

type CanSendImage

type CanSendImage struct {
	CanSendImage int8 `json:"-"`
}

type CanSendImageResult

type CanSendImageResult struct {
	// Whether the bot can send image
	Yes bool `json:"yes"`
}

type CanSendRecord

type CanSendRecord struct {
	CanSendRecord int8 `json:"-"`
}

type CanSendRecordResult

type CanSendRecordResult struct {
	// Whether the bot can send record
	Yes bool `json:"yes"`
}

type CleanCache

type CleanCache struct {
	CleanCache int8 `json:"-"`
}

type ContactType

type ContactType struct {
	message.MessageType
	// "qq" or "group"
	Type string `json:"type"`
	ID   string `json:"id"`
}

func (ContactType) AdapterName

func (serializer ContactType) AdapterName() string

func (ContactType) ToRawText

func (contact ContactType) ToRawText(msg message.MessageSegment) string

func (ContactType) TypeName

func (serializer ContactType) TypeName() string

type DeleteMessage

type DeleteMessage struct {
	MessageID int64 `json:"message_id"`
}

type DiceType

type DiceType struct {
	message.MessageType
}

func (DiceType) AdapterName

func (serializer DiceType) AdapterName() string

func (DiceType) ToRawText

func (dice DiceType) ToRawText(msg message.MessageSegment) string

func (DiceType) TypeName

func (serializer DiceType) TypeName() string

type EmptyResult

type EmptyResult struct{}

No result should return this

type FaceType

type FaceType struct {
	message.MessageType
	ID string `json:"id"`
}

func (FaceType) AdapterName

func (serializer FaceType) AdapterName() string

func (FaceType) ToRawText

func (face FaceType) ToRawText(msg message.MessageSegment) string

func (FaceType) TypeName

func (serializer FaceType) TypeName() string

type FileObject

type FileObject struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Size  int64  `json:"size"`
	Busid int64  `json:"busid"`
}

type ForwardType

type ForwardType struct {
	message.MessageType
	ID string `json:"id"`
}

func (ForwardType) AdapterName

func (serializer ForwardType) AdapterName() string

func (ForwardType) ToRawText

func (forward ForwardType) ToRawText(msg message.MessageSegment) string

func (ForwardType) TypeName

func (serializer ForwardType) TypeName() string

type FriendAdd

type FriendAdd struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "friend_add"
	NoticeType string `json:"notice_type"`
	UserID     int64  `json:"user_id"`
}

func (FriendAdd) AdapterName

func (friendAdd FriendAdd) AdapterName() string

func (FriendAdd) ToRawText

func (friendAdd FriendAdd) ToRawText(msg message.MessageSegment) string

func (FriendAdd) TypeName

func (friendAdd FriendAdd) TypeName() string

type FriendPoke

type FriendPoke struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "notify"
	NoticeType string `json:"notice_type"`
	// "poke"
	SubType string `json:"sub_type"`
	// Poker ID
	UserID int64 `json:"user_id"`
	// Pokee ID
	TargetID int64 `json:"target_id"`
}

func (FriendPoke) AdapterName

func (friendPoke FriendPoke) AdapterName() string

func (FriendPoke) ToRawText

func (friendPoke FriendPoke) ToRawText(msg message.MessageSegment) string

func (FriendPoke) TypeName

func (friendPoke FriendPoke) TypeName() string

type FriendRecall

type FriendRecall struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "friend_recall"
	NoticeType string `json:"notice_type"`
	// Recaller ID
	UserID    int64 `json:"user_id"`
	MessageID int64 `json:"message_id"`
}

func (FriendRecall) AdapterName

func (friendRecall FriendRecall) AdapterName() string

func (FriendRecall) ToRawText

func (friendRecall FriendRecall) ToRawText(msg message.MessageSegment) string

func (FriendRecall) TypeName

func (friendRecall FriendRecall) TypeName() string

type FriendRequest

type FriendRequest struct {
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "friend"
	RequestType string `json:"request_type"`
	// New friend ID
	UserId int64 `json:"user_id"`
	// Request comment
	Comment string `json:"comment"`
	// Flag for handling this request
	Flag string `json:"flag"`
}

type GetCookies

type GetCookies struct {
	Domain string `json:"domain"`
}

type GetCookiesResult

type GetCookiesResult struct {
	Cookies string `json:"cookies"`
}

type GetCredentials

type GetCredentials struct {
	Domain string `json:"domain"`
}

type GetCredentialsResult

type GetCredentialsResult struct {
	Cookies   string `json:"cookies"`
	CsrfToken int64  `json:"csrf_token"`
}

type GetCsrfToken

type GetCsrfToken struct {
	GetCsrfToken int8 `json:"-"`
}

type GetCsrfTokenResult

type GetCsrfTokenResult struct {
	CsrfToken int64 `json:"csrf_token"`
}

type GetForwardMessage

type GetForwardMessage struct {
	ID string `json:"id"`
}

type GetForwardMessageResult

type GetForwardMessageResult struct {
	Message []PayloadMessage `json:"Message"`
}

type GetFriendList

type GetFriendList struct {
	GetFriendList int8 `json:"-"`
}

type GetFriendListResult

type GetFriendListResult struct {
	UserID   int64  `json:"user_id"`
	Nickname string `json:"nickname"`
	Remark   string `json:"remark"`
}

type GetGroupHonorInfo

type GetGroupHonorInfo struct {
	GroupID int64 `json:"group_id"`
	// Type of the honor you want to know
	//
	// "talkative", "performer", "legend", "strong_newbie", "emotion", or "all" to get all the types
	Type string `json:"type"`
}

type GetGroupHonorInfoResult

type GetGroupHonorInfoResult struct {
	GroupID          int64              `json:"group_id"`
	CurrentTalkative GroupTalkativeInfo `json:"current_talkative"`
	TalkativeList    []GroupHonorInfo   `json:"talkative_list"`
	PerformerList    []GroupHonorInfo   `json:"performer_list"`
	LegendList       []GroupHonorInfo   `json:"legend_list"`
	StrongNewbieList []GroupHonorInfo   `json:"strong_newbie_list"`
	EmotionList      []GroupHonorInfo   `json:"emotion_list"`
}

type GetGroupInfo

type GetGroupInfo struct {
	GroupID int64 `json:"group_id"`
	// Whether to use cache(using cache leads to faster response, but may be outdated)
	NoCache bool `json:"no_cache"`
}

type GetGroupInfoResult

type GetGroupInfoResult struct {
	GroupID        int64  `json:"group_id"`
	GroupName      string `json:"group_name"`
	MemberCount    int64  `json:"member_count"`
	MaxMemberCount int64  `json:"max_member_count"`
}

type GetGroupList

type GetGroupList struct {
	GetGroupList int8 `json:"-"`
}

type GetGroupListResult

type GetGroupListResult []GetGroupInfoResult

type GetGroupMemberInfo

type GetGroupMemberInfo struct {
	GroupID int64 `json:"group_id"`
	UserID  int64 `json:"user_id"`
	// Whether to use cache(using cache leads to faster response, but may be outdated)
	NoCache bool `json:"no_cache"`
}

type GetGroupMemberInfoResult

type GetGroupMemberInfoResult struct {
	// User info
	GroupID  int64  `json:"group_id"`
	UserID   int64  `json:"user_id"`
	Nickname string `json:"nickname"`
	Card     string `json:"card"`
	Sex      string `json:"sex"`
	Age      int64  `json:"age"`
	Area     string `json:"area"`
	// Group message info
	JoinTime     int64  `json:"join_time"`
	LastSentTime int64  `json:"last_sent_time"`
	Level        string `json:"level"`
	// Group user info
	// "owner", "admin" or "member"
	Role            string `json:"role"`
	Unfriendly      bool   `json:"unfriendly"`
	Title           string `json:"title"`
	TitleExpireTime int64  `json:"title_expire_time"`
	CardChangeable  bool   `json:"card_changeable"`
}

type GetGroupMemberList

type GetGroupMemberList struct {
	GroupID int64 `json:"group_id"`
}

type GetGroupMemberListResult

type GetGroupMemberListResult []GetGroupMemberInfoResult

type GetImage

type GetImage struct {
	// File name received
	File string `json:"file"`
}

type GetImageResult

type GetImageResult struct {
	// Local file path
	File string `json:"file"`
}

type GetLoginInfo

type GetLoginInfo struct {
	UserID   int64  `json:"user_id"`
	Nickname string `json:"nickname"`
}

type GetMessage

type GetMessage struct {
	MessageID int64 `json:"message_id"`
}

type GetMessageResult

type GetMessageResult struct {
	Time        int64            `json:"time"`
	MessageType string           `json:"message_type"`
	MessageID   int64            `json:"message_id"`
	RealID      int64            `json:"real_id"`
	Sender      SenderObject     `json:"sender"`
	Message     []PayloadMessage `json:"message"`
}

type GetRecord

type GetRecord struct {
	// File name received
	File string `json:"file"`
	// Target format
	OutFormat string `json:"out_format"`
}

To use this, you may need to get ffmpeg installed(the app you are using must support this)

type GetRecordResult

type GetRecordResult struct {
	// Local file path
	File string `json:"file"`
}

type GetStatus

type GetStatus struct {
	GetStatus int8 `json:"-"`
}

type GetStatusResult

type GetStatusResult struct {
	// Will be null if can't query(I wonder how to express this)
	Online bool `json:"online"`
	// Whether everything is functioning well
	Good bool `json:"good"`
}

type GetStrangerInfo

type GetStrangerInfo struct {
	UserID int64 `json:"user_id"`
	// Whether to use cache(using cache leads to faster response, but may be outdated)
	NoCache bool `json:"no_cache"`
}

type GetVersionInfo

type GetVersionInfo struct {
	GetVersionInfo int8 `json:"-"`
}

type GetVersionInfoResult

type GetVersionInfoResult struct {
	// Name of the app
	AppName string `json:"app_name"`
	// Version of the app
	AppVersion string `json:"app_version"`
	// OneBot version
	ProtocolVersion string `json:"protocol_version"`
}

type GroupBan

type GroupBan struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "group_ban"
	NoticeType string `json:"notice_type"`
	// "ban" or "lift_ban"
	SubType    string `json:"sub_type"`
	GroupID    int64  `json:"group_id"`
	OperatorID int64  `json:"operator_id"`
	// Victim ID
	UserID   int64 `json:"user_id"`
	Duration int64 `json:"duration"`
}

func (GroupBan) AdapterName

func (groupBan GroupBan) AdapterName() string

func (GroupBan) ToRawText

func (groupBan GroupBan) ToRawText(msg message.MessageSegment) string

func (GroupBan) TypeName

func (groupBan GroupBan) TypeName() string

type GroupFileUpload

type GroupFileUpload struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "group_upload"
	NoticeType string `json:"notice_type"`
	GroupID    int64  `json:"group_id"`
	// Sender ID
	UserID int64      `json:"user_id"`
	File   FileObject `json:"file"`
}

func (GroupFileUpload) AdapterName

func (fileUpload GroupFileUpload) AdapterName() string

func (GroupFileUpload) ToRawText

func (fileUpload GroupFileUpload) ToRawText(msg message.MessageSegment) string

func (GroupFileUpload) TypeName

func (fileUpload GroupFileUpload) TypeName() string

type GroupHonorChange

type GroupHonorChange struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "notify"
	NoticeType string `json:"notice_type"`
	// "honor"
	SubType string `json:"sub_type"`
	// Group ID
	GroupID int64 `json:"group_id"`
	// Honoree ID
	UserID int64 `json:"user_id"`
	// "talkative", "performer" or "emotion"
	HonorType string `json:"honor_type"`
}

func (GroupHonorChange) AdapterName

func (groupHonorChange GroupHonorChange) AdapterName() string

func (GroupHonorChange) ToRawText

func (groupHonorChange GroupHonorChange) ToRawText(msg message.MessageSegment) string

func (GroupHonorChange) TypeName

func (groupHonorChange GroupHonorChange) TypeName() string

type GroupHonorInfo

type GroupHonorInfo struct {
	UserID   int64 `json:"user_id"`
	Nickname int64 `json:"nickname"`
	// Url of the avatar
	Avatar      string `json:"avatar"`
	Description string `json:"description"`
}

type GroupMemberDecrease

type GroupMemberDecrease struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "group_decrease"
	NoticeType string `json:"notice_type"`
	// "leave" or "kick" or "kick_me"
	SubType    string `json:"sub_type"`
	GroupID    int64  `json:"group_id"`
	OperatorID int64  `json:"operator_id"`
	// Victim ID
	UserID int64 `json:"user_id"`
}

func (GroupMemberDecrease) AdapterName

func (groupMemberDecrease GroupMemberDecrease) AdapterName() string

func (GroupMemberDecrease) ToRawText

func (groupMemberDecrease GroupMemberDecrease) ToRawText(msg message.MessageSegment) string

func (GroupMemberDecrease) TypeName

func (groupMemberDecrease GroupMemberDecrease) TypeName() string

type GroupMemberIncrease

type GroupMemberIncrease struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "group_increase"
	NoticeType string `json:"notice_type"`
	// "approve" or "invite"
	SubType    string `json:"sub_type"`
	GroupID    int64  `json:"group_id"`
	OperatorID int64  `json:"operator_id"`
	// Joiner ID
	UserID int64 `json:"user_id"`
}

func (GroupMemberIncrease) AdapterName

func (groupMemberIncrease GroupMemberIncrease) AdapterName() string

func (GroupMemberIncrease) ToRawText

func (groupMemberIncrease GroupMemberIncrease) ToRawText(msg message.MessageSegment) string

func (GroupMemberIncrease) TypeName

func (groupMemberIncrease GroupMemberIncrease) TypeName() string

type GroupMessage

type GroupMessage struct {
	Time        int64  `json:"time"`
	SelfID      int64  `json:"self_id"`
	PostType    string `json:"post_type"`
	MessageType string `json:"message_type"`
	// "normal", "notice" or "active"
	SubType    string           `json:"sub_type"`
	MessageID  int64            `json:"message_id"`
	GroupID    int64            `json:"group_id"`
	UserID     int64            `json:"user_id"`
	Message    []PayloadMessage `json:"message"`
	RawMessage string           `json:"raw_message"`
	Font       int64            `json:"font"`
	Sender     SenderObject     `json:"sender"`
}

type GroupPoke

type GroupPoke struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "notify"
	NoticeType string `json:"notice_type"`
	GroupID    int64  `json:"group_id"`
	// "poke"
	SubType string `json:"sub_type"`
	// Poker ID
	UserID int64 `json:"user_id"`
	// Pokee ID
	TargetID int64 `json:"target_id"`
}

func (GroupPoke) AdapterName

func (groupPoke GroupPoke) AdapterName() string

func (GroupPoke) ToRawText

func (groupPoke GroupPoke) ToRawText(msg message.MessageSegment) string

func (GroupPoke) TypeName

func (groupPoke GroupPoke) TypeName() string

type GroupRecall

type GroupRecall struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "group_recall"
	NoticeType string `json:"notice_type"`
	GroupID    int64  `json:"group_id"`
	OperatorID int64  `json:"operator_id"`
	// Recaller ID
	UserID int64 `json:"user_id"`
	// Message ID
	MessageID int64 `json:"message_id"`
}

func (GroupRecall) AdapterName

func (groupRecall GroupRecall) AdapterName() string

func (GroupRecall) ToRawText

func (groupRecall GroupRecall) ToRawText(msg message.MessageSegment) string

func (GroupRecall) TypeName

func (groupRecall GroupRecall) TypeName() string

type GroupRequest

type GroupRequest struct {
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "group"
	RequestType string `json:"request_type"`
	// "add" or "invite"
	SubType string `json:"sub_type"`
	GroupId int64  `json:"group_id"`
	// Inviter ID
	UserId int64 `json:"user_id"`
	// Request comment
	Comment string `json:"comment"`
	// Flag for handling this request
	Flag string `json:"flag"`
}

type GroupTalkativeInfo

type GroupTalkativeInfo struct {
	UserID   int64 `json:"user_id"`
	Nickname int64 `json:"nickname"`
	// Url of the avatar
	Avatar string `json:"avatar"`
	// How long it have lasted
	DayCount int64 `json:"day_count"`
}

type JSONType

type JSONType struct {
	message.MessageType
	Data string `json:"data"`
}

func (JSONType) AdapterName

func (serializer JSONType) AdapterName() string

func (JSONType) ToRawText

func (json JSONType) ToRawText(msg message.MessageSegment) string

func (JSONType) TypeName

func (serializer JSONType) TypeName() string

type LocationType

type LocationType struct {
	message.MessageType
	Lat string `json:"lat"`
	Lon string `json:"lon"`
}

func (LocationType) AdapterName

func (serializer LocationType) AdapterName() string

func (LocationType) ToRawText

func (location LocationType) ToRawText(msg message.MessageSegment) string

func (LocationType) TypeName

func (serializer LocationType) TypeName() string

type MusicType

type MusicType struct {
	message.MessageType
	// "qq", "163", "xm" or "custom"
	Type string `json:"type"`
	// Official
	ID string `json:"id"`
	// Custom
	Url     string `json:"url"`
	Audio   string `json:"audio"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Image   string `json:"image"`
}

func (MusicType) AdapterName

func (serializer MusicType) AdapterName() string

func (MusicType) ToRawText

func (music MusicType) ToRawText(msg message.MessageSegment) string

func (MusicType) TypeName

func (serializer MusicType) TypeName() string

type NodeType

type NodeType struct {
	message.MessageType
	// By ID
	ID string `json:"id"`
	// Custom
	UserID   string                   `json:"user_id"`
	Nickname string                   `json:"nickname"`
	Content  []message.MessageSegment `json:"content"`
}

Node for forward

func (NodeType) AdapterName

func (serializer NodeType) AdapterName() string

func (NodeType) ToRawText

func (node NodeType) ToRawText(msg message.MessageSegment) string

func (NodeType) TypeName

func (serializer NodeType) TypeName() string

type PayloadMessage

type PayloadMessage struct {
	Type string `json:"type"`
	Data any    `json:"data"`
}

type PokeType

type PokeType struct {
	message.MessageType
	ID   string `json:"id"`
	Type string `json:"type"`
}

func (PokeType) AdapterName

func (serializer PokeType) AdapterName() string

func (PokeType) ToRawText

func (poke PokeType) ToRawText(msg message.MessageSegment) string

func (PokeType) TypeName

func (serializer PokeType) TypeName() string

type PrivateMessage

type PrivateMessage struct {
	Time        int64  `json:"time"`
	SelfID      int64  `json:"self_id"`
	PostType    string `json:"post_type"`
	MessageType string `json:"message_type"`
	// "friend", "group" or "other"
	SubType    string           `json:"sub_type"`
	MessageID  int64            `json:"message_id"`
	UserID     int64            `json:"user_id"`
	Message    []PayloadMessage `json:"message"`
	RawMessage string           `json:"raw_message"`
	Font       int64            `json:"font"`
	Sender     SenderObject     `json:"sender"`
}

type RPSType

type RPSType struct {
	message.MessageType
}

func (RPSType) AdapterName

func (serializer RPSType) AdapterName() string

func (RPSType) ToRawText

func (rsp RPSType) ToRawText(msg message.MessageSegment) string

func (RPSType) TypeName

func (serializer RPSType) TypeName() string

type RedPacketLuckyKing

type RedPacketLuckyKing struct {
	message.MessageType
	Time     int64  `json:"time"`
	SelfID   int64  `json:"self_id"`
	PostType string `json:"post_type"`
	// "notify"
	NoticeType string `json:"notice_type"`
	// "lucky_king"
	SubType string `json:"sub_type"`
	// Group ID
	GroupID int64 `json:"group_id"`
	// Red packet sender ID
	UserID int64 `json:"user_id"`
	// Lucky king ID
	TargetID int64 `json:"target_id"`
}

func (RedPacketLuckyKing) AdapterName

func (redPacketLuckyKing RedPacketLuckyKing) AdapterName() string

func (RedPacketLuckyKing) ToRawText

func (redPacketLuckyKing RedPacketLuckyKing) ToRawText(msg message.MessageSegment) string

func (RedPacketLuckyKing) TypeName

func (redPacketLuckyKing RedPacketLuckyKing) TypeName() string

type ReplyType

type ReplyType struct {
	message.MessageType
	ID string `json:"id"`
}

func (ReplyType) AdapterName

func (serializer ReplyType) AdapterName() string

func (ReplyType) ToRawText

func (reply ReplyType) ToRawText(msg message.MessageSegment) string

func (ReplyType) TypeName

func (serializer ReplyType) TypeName() string

type SendGroupMessage

type SendGroupMessage struct {
	GroupID int64            `json:"group_id"`
	Message []PayloadMessage `json:"message"`
	// True if message is string, false otherwise
	AutoEscape bool `json:"auto_escape"`
}

type SendLike

type SendLike struct {
	UserID int64 `json:"user_id"`
	Times  int64 `json:"times"`
}

type SendPrivateMessage

type SendPrivateMessage struct {
	UserID  int64            `json:"user_id"`
	Message []PayloadMessage `json:"message"`
	// True if message is string, false otherwise
	AutoEscape bool `json:"auto_escape"`
}

type SenderObject

type SenderObject struct {
	UserID   int64  `json:"user_id"`
	Nickname string `json:"nickname"`
	Sex      string `json:"sex"`
	Age      int64  `json:"age"`
	// If is a group message, SenderObject may also contain the following fields
	Card  string `json:"card"`
	Area  string `json:"area"`
	Level string `json:"level"`
	// "owner", "admin" or "member"
	Role  string `json:"Role"`
	Title string `json:"Title"`
}

You shouldn't assume that every field in this struct does exists in actual json string

type SetFriendAddRequest

type SetFriendAddRequest struct {
	Flag string `json:"flag"`
	// True to approve, false to refuse
	Approve bool `json:"approve"`
	// Optional, sets the friend remark, only works when approve is true
	Remark string `json:"remark"`
}

type SetGroupAddRequest

type SetGroupAddRequest struct {
	Flag string `json:"flag"`
	// "add" or "invite", which means the type of the request is add or invite
	SubType string `json:"sub_type"`
	// True to approve, false to refuse
	Approve bool `json:"approve"`
	// Optional, reason for rejecting the request, only works when approve is false
	Reason string `json:"reason"`
}

type SetGroupAdmin

type SetGroupAdmin struct {
	GroupID int64 `json:"group_id"`
	UserID  int64 `json:"user_id"`
	// True to set as admin, false to cancel
	Enable bool `json:"enable"`
}

type SetGroupBan

type SetGroupBan struct {
	GroupID int64 `json:"group_id"`
	UserID  int64 `json:"user_id"`
	// Use second as unit, value 0 means cancel the ban
	Duration int64 `json:"duration"`
}

type SetGroupCard

type SetGroupCard struct {
	GroupID int64 `json:"group_id"`
	UserID  int64 `json:"user_id"`
	// Sets the group card, leave it empty to remove the group card
	Card string `json:"card"`
}

type SetGroupKick

type SetGroupKick struct {
	GroupID int64 `json:"group_id"`
	UserID  int64 `json:"user_id"`
	// Whether to always reject the add request of the user
	RejectAddRequest bool `json:"reject_add_request"`
}

type SetGroupLeave

type SetGroupLeave struct {
	GroupID int64 `json:"group_id"`
	// Dissolve the group if true(and the bot is the owner)
	IsDismiss bool `json:"is_dismiss"`
}

type SetGroupName

type SetGroupName struct {
	GroupID int64  `json:"group_id"`
	Name    string `json:"name"`
}

type SetGroupSpecialTitle

type SetGroupSpecialTitle struct {
	GroupID int64 `json:"group_id"`
	UserID  int64 `json:"user_id"`
	// Leave it empty to remove the special title
	SpecialTitle string `json:"special_title"`
	// Expiration time, use second as unit, value -1 means no expiration, seems not functioning
	Duration int64 `json:"duration"`
}

type SetGroupWholeBan

type SetGroupWholeBan struct {
	GroupID int64 `json:"group_id"`
	// True to ban, false to cancel
	Enable bool `json:"enable"`
}

type SetRestart

type SetRestart struct {
	// Milliseconds before restart, if cannot restart normally, try set it to about 2000
	Delay int64 `json:"delay"`
}

type ShakeType

type ShakeType struct {
	message.MessageType
}

func (ShakeType) AdapterName

func (serializer ShakeType) AdapterName() string

func (ShakeType) ToRawText

func (shake ShakeType) ToRawText(msg message.MessageSegment) string

func (ShakeType) TypeName

func (serializer ShakeType) TypeName() string

type ShareType

type ShareType struct {
	message.MessageType
	Url string `json:"url"`
}

func (ShareType) AdapterName

func (serializer ShareType) AdapterName() string

func (ShareType) ToRawText

func (share ShareType) ToRawText(msg message.MessageSegment) string

func (ShareType) TypeName

func (serializer ShareType) TypeName() string

type XMLType

type XMLType struct {
	message.MessageType
	Data string `json:"data"`
}

func (XMLType) AdapterName

func (serializer XMLType) AdapterName() string

func (XMLType) ToRawText

func (xml XMLType) ToRawText(msg message.MessageSegment) string

func (XMLType) TypeName

func (serializer XMLType) TypeName() string

Jump to

Keyboard shortcuts

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