coolq

package
v0.0.0-...-8277a9f Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Package coolq 包含CQBot实例,CQ码处理,消息发送,消息处理等的相关函数与结构体

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Failed

func Failed(code int, msg ...string) global.MSG

Failed 生成失败返回值

func FeedContentsToArrayMessage

func FeedContentsToArrayMessage(contents []topic.IFeedRichContentElement) []global.MSG

FeedContentsToArrayMessage 将话题频道帖子内容转换为 Array Message

func OK

func OK(data any) global.MSG

OK 生成成功返回值

func ToFormattedMessage

func ToFormattedMessage(e []message.IMessageElement, source message.Source) (r any)

ToFormattedMessage 将给定[]message.IMessageElement转换为通过coolq.SetMessageFormat所定义的消息上报格式

func ToMessageContent

func ToMessageContent(e []message.IMessageElement, source message.Source) (r []global.MSG)

ToMessageContent 将消息转换成 Content. 忽略 Reply 不同于 onebot 的 Array Message, 此函数转换出来的 Content 的 data 段为实际类型 方便数据库查询

Types

type CQBot

type CQBot struct {
	Client *client.QQClient
	// contains filtered or unexported fields
}

CQBot CQBot结构体,存储Bot实例相关配置

func NewQQBot

func NewQQBot(cli *client.QQClient) *CQBot

NewQQBot 初始化一个QQBot实例

func (*CQBot) CQCanSendImage

func (bot *CQBot) CQCanSendImage() global.MSG

CQCanSendImage 检查是否可以发送图片(此处永远返回true)

https://git.io/Jtz1N @route11(can_send_image)

func (*CQBot) CQCanSendRecord

func (bot *CQBot) CQCanSendRecord() global.MSG

CQCanSendRecord 检查是否可以发送语音(此处永远返回true)

https://git.io/Jtz1x @route11(can_send_record)

func (*CQBot) CQCheckURLSafely

func (bot *CQBot) CQCheckURLSafely(url string) global.MSG

CQCheckURLSafely 扩展API-检查链接安全性

https://docs.go-cqhttp.org/api/#%E6%A3%80%E6%9F%A5%E9%93%BE%E6%8E%A5%E5%AE%89%E5%85%A8%E6%80%A7 @route(check_url_safely)

func (*CQBot) CQCreateGuildRole

func (bot *CQBot) CQCreateGuildRole(guildID uint64, name string, color uint32, independent bool, initialUsers gjson.Result) global.MSG

CQCreateGuildRole 创建频道角色 @route(create_guild_role)

func (*CQBot) CQDelGroupMemo

func (bot *CQBot) CQDelGroupMemo(groupID int64, fid string) global.MSG

CQDelGroupMemo 扩展API-删除群公告 @route(_del_group_notice) @rename(fid->notice_id)

func (*CQBot) CQDeleteEssenceMessage

func (bot *CQBot) CQDeleteEssenceMessage(messageID int32) global.MSG

CQDeleteEssenceMessage 扩展API-移出精华消息

https://docs.go-cqhttp.org/api/#%E7%A7%BB%E5%87%BA%E7%B2%BE%E5%8D%8E%E6%B6%88%E6%81%AF @route(delete_essence_msg)

func (*CQBot) CQDeleteFriend

func (bot *CQBot) CQDeleteFriend(uin int64) global.MSG

CQDeleteFriend 删除好友 @route(delete_friend) @rename(uin->"[user_id\x2Cid].0")

func (*CQBot) CQDeleteGuildRole

func (bot *CQBot) CQDeleteGuildRole(guildID uint64, roleID uint64) global.MSG

CQDeleteGuildRole 删除频道角色 @route(delete_guild_role)

func (*CQBot) CQDeleteMessage

func (bot *CQBot) CQDeleteMessage(messageID int32) global.MSG

CQDeleteMessage 撤回消息

https:// git.io/Jtz1y @route(delete_msg)

func (*CQBot) CQDeleteUnidirectionalFriend

func (bot *CQBot) CQDeleteUnidirectionalFriend(uin int64) global.MSG

CQDeleteUnidirectionalFriend 删除单向好友

@route(delete_unidirectional_friend) @rename(uin->user_id)

func (*CQBot) CQDownloadFile

func (bot *CQBot) CQDownloadFile(url string, headers gjson.Result, threadCount int) global.MSG

CQDownloadFile 扩展API-下载文件到缓存目录

https://docs.go-cqhttp.org/api/#%E4%B8%8B%E8%BD%BD%E6%96%87%E4%BB%B6%E5%88%B0%E7%BC%93%E5%AD%98%E7%9B%AE%E5%BD%95 @route(download_file)

func (*CQBot) CQGetAtAllRemain

func (bot *CQBot) CQGetAtAllRemain(groupID int64) global.MSG

CQGetAtAllRemain 扩展API-获取群 @全体成员 剩余次数

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%BE%A4-%E5%85%A8%E4%BD%93%E6%88%90%E5%91%98-%E5%89%A9%E4%BD%99%E6%AC%A1%E6%95%B0 @route(get_group_at_all_remain)

func (*CQBot) CQGetEssenceMessageList

func (bot *CQBot) CQGetEssenceMessageList(groupID int64) global.MSG

CQGetEssenceMessageList 扩展API-获取精华消息列表

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%B2%BE%E5%8D%8E%E6%B6%88%E6%81%AF%E5%88%97%E8%A1%A8 @route(get_essence_msg_list)

func (*CQBot) CQGetForwardMessage

func (bot *CQBot) CQGetForwardMessage(resID string) global.MSG

CQGetForwardMessage 获取合并转发消息

https://git.io/Jtz1F @route(get_forward_msg) @rename(res_id->"[message_id\x2Cid].0")

func (*CQBot) CQGetFriendList

func (bot *CQBot) CQGetFriendList(spec *onebot.Spec) global.MSG

CQGetFriendList 获取好友列表

https://git.io/Jtz1L @route(get_friend_list)

func (*CQBot) CQGetGroupFileSystemInfo

func (bot *CQBot) CQGetGroupFileSystemInfo(groupID int64) global.MSG

CQGetGroupFileSystemInfo 扩展API-获取群文件系统信息

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%BE%A4%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF @route(get_group_file_system_info)

func (*CQBot) CQGetGroupFileURL

func (bot *CQBot) CQGetGroupFileURL(groupID int64, fileID string, busID int32) global.MSG

CQGetGroupFileURL 扩展API-获取群文件资源链接

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%BE%A4%E6%96%87%E4%BB%B6%E8%B5%84%E6%BA%90%E9%93%BE%E6%8E%A5 @route(get_group_file_url) @rename(bus_id->"[busid\x2Cbus_id].0")

func (*CQBot) CQGetGroupFilesByFolderID

func (bot *CQBot) CQGetGroupFilesByFolderID(groupID int64, folderID string) global.MSG

CQGetGroupFilesByFolderID 扩展API-获取群子目录文件列表

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%BE%A4%E5%AD%90%E7%9B%AE%E5%BD%95%E6%96%87%E4%BB%B6%E5%88%97%E8%A1%A8 @route(get_group_files_by_folder)

func (*CQBot) CQGetGroupHonorInfo

func (bot *CQBot) CQGetGroupHonorInfo(groupID int64, t string) global.MSG

CQGetGroupHonorInfo 获取群荣誉信息

https://git.io/Jtz1H @route(get_group_honor_info) @rename(t->type)

func (*CQBot) CQGetGroupInfo

func (bot *CQBot) CQGetGroupInfo(groupID int64, noCache bool, spec *onebot.Spec) global.MSG

CQGetGroupInfo 获取群信息

https://git.io/Jtz1O @route(get_group_info)

func (*CQBot) CQGetGroupList

func (bot *CQBot) CQGetGroupList(noCache bool, spec *onebot.Spec) global.MSG

CQGetGroupList 获取群列表

https://git.io/Jtz1t @route(get_group_list)

func (*CQBot) CQGetGroupMemberInfo

func (bot *CQBot) CQGetGroupMemberInfo(groupID, userID int64, noCache bool) global.MSG

CQGetGroupMemberInfo 获取群成员信息

https://git.io/Jtz1s @route(get_group_member_info)

func (*CQBot) CQGetGroupMemberList

func (bot *CQBot) CQGetGroupMemberList(groupID int64, noCache bool) global.MSG

CQGetGroupMemberList 获取群成员列表

https://git.io/Jtz13 @route(get_group_member_list)

func (*CQBot) CQGetGroupMemo

func (bot *CQBot) CQGetGroupMemo(groupID int64) global.MSG

CQGetGroupMemo 扩展API-获取群公告 @route(_get_group_notice)

func (*CQBot) CQGetGroupMessageHistory

func (bot *CQBot) CQGetGroupMessageHistory(groupID int64, seq int64) global.MSG

CQGetGroupMessageHistory 获取群消息历史记录

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%BE%A4%E6%B6%88%E6%81%AF%E5%8E%86%E5%8F%B2%E8%AE%B0%E5%BD%95 @route(get_group_msg_history) @rename(seq->message_seq)

func (*CQBot) CQGetGroupRootFiles

func (bot *CQBot) CQGetGroupRootFiles(groupID int64) global.MSG

CQGetGroupRootFiles 扩展API-获取群根目录文件列表

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%BE%A4%E6%A0%B9%E7%9B%AE%E5%BD%95%E6%96%87%E4%BB%B6%E5%88%97%E8%A1%A8 @route(get_group_root_files)

func (*CQBot) CQGetGroupSystemMessages

func (bot *CQBot) CQGetGroupSystemMessages() global.MSG

CQGetGroupSystemMessages 扩展API-获取群文件系统消息

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E7%BE%A4%E7%B3%BB%E7%BB%9F%E6%B6%88%E6%81%AF @route(get_group_system_msg)

func (*CQBot) CQGetGuildChannelList

func (bot *CQBot) CQGetGuildChannelList(guildID uint64, noCache bool) global.MSG

CQGetGuildChannelList 获取频道列表 @route(get_guild_channel_list)

func (*CQBot) CQGetGuildList

func (bot *CQBot) CQGetGuildList() global.MSG

CQGetGuildList 获取已加入的频道列表 @route(get_guild_list)

func (*CQBot) CQGetGuildMemberProfile

func (bot *CQBot) CQGetGuildMemberProfile(guildID, userID uint64) global.MSG

CQGetGuildMemberProfile 获取频道成员资料 @route(get_guild_member_profile)

func (*CQBot) CQGetGuildMembers

func (bot *CQBot) CQGetGuildMembers(guildID uint64, nextToken string) global.MSG

CQGetGuildMembers 获取频道成员列表 @route(get_guild_member_list)

func (*CQBot) CQGetGuildMessage

func (bot *CQBot) CQGetGuildMessage(messageID string, noCache bool) global.MSG

CQGetGuildMessage 获取频道消息 @route(get_guild_msg)

func (*CQBot) CQGetGuildMetaByGuest

func (bot *CQBot) CQGetGuildMetaByGuest(guildID uint64) global.MSG

CQGetGuildMetaByGuest 通过访客权限获取频道元数据 @route(get_guild_meta_by_guest)

func (*CQBot) CQGetGuildRoles

func (bot *CQBot) CQGetGuildRoles(guildID uint64) global.MSG

CQGetGuildRoles 获取频道角色列表 @route(get_guild_roles)

func (*CQBot) CQGetGuildServiceProfile

func (bot *CQBot) CQGetGuildServiceProfile() global.MSG

CQGetGuildServiceProfile 获取频道系统个人资料 @route(get_guild_service_profile)

func (*CQBot) CQGetImage

func (bot *CQBot) CQGetImage(file string) global.MSG

CQGetImage 获取图片(修改自OneBot)

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E5%9B%BE%E7%89%87%E4%BF%A1%E6%81%AF @route(get_image)

func (*CQBot) CQGetLoginInfo

func (bot *CQBot) CQGetLoginInfo() global.MSG

CQGetLoginInfo 获取登录号信息

https://git.io/Jtz1I @route11(get_login_info) @route12(get_self_info)

func (*CQBot) CQGetMessage

func (bot *CQBot) CQGetMessage(messageID int32) global.MSG

CQGetMessage 获取消息

https://git.io/Jtz1b @route(get_msg)

func (*CQBot) CQGetModelShow

func (bot *CQBot) CQGetModelShow(model string) global.MSG

CQGetModelShow 获取在线机型

https://club.vip.qq.com/onlinestatus/set @route(_get_model_show)

func (*CQBot) CQGetOnlineClients

func (bot *CQBot) CQGetOnlineClients(noCache bool) global.MSG

CQGetOnlineClients 扩展API-获取当前账号在线客户端列表

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E8%B4%A6%E5%8F%B7%E5%9C%A8%E7%BA%BF%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%88%97%E8%A1%A8 @route(get_online_clients)

func (*CQBot) CQGetQiDianAccountInfo

func (bot *CQBot) CQGetQiDianAccountInfo() global.MSG

CQGetQiDianAccountInfo 获取企点账号信息 @route(qidian_get_account_info)

func (*CQBot) CQGetStatus

func (bot *CQBot) CQGetStatus(spec *onebot.Spec) global.MSG

CQGetStatus 获取运行状态

https://git.io/JtzMe @route(get_status)

func (*CQBot) CQGetStrangerInfo

func (bot *CQBot) CQGetStrangerInfo(userID int64) global.MSG

CQGetStrangerInfo 获取陌生人信息

https://git.io/Jtz17 @route11(get_stranger_info) @route12(get_user_info)

func (*CQBot) CQGetSupportedActions

func (bot *CQBot) CQGetSupportedActions(spec *onebot.Spec) global.MSG

CQGetSupportedActions 获取支持的动作列表

@route(get_supported_actions)

func (*CQBot) CQGetTopicChannelFeeds

func (bot *CQBot) CQGetTopicChannelFeeds(guildID, channelID uint64) global.MSG

CQGetTopicChannelFeeds 获取话题频道帖子列表 @route(get_topic_channel_feeds)

func (*CQBot) CQGetUnidirectionalFriendList

func (bot *CQBot) CQGetUnidirectionalFriendList() global.MSG

CQGetUnidirectionalFriendList 获取单向好友列表

@route(get_unidirectional_friend_list)

func (*CQBot) CQGetVersion

func (bot *CQBot) CQGetVersion() global.MSG

CQGetVersion 获取版本信息 OneBotV12

https://git.io/JtwUs @route12(get_version)

func (*CQBot) CQGetVersionInfo

func (bot *CQBot) CQGetVersionInfo() global.MSG

CQGetVersionInfo 获取版本信息

https://git.io/JtwUs @route11(get_version_info)

func (*CQBot) CQGetWordSlices

func (bot *CQBot) CQGetWordSlices(content string) global.MSG

CQGetWordSlices 隐藏API-获取中文分词

https://docs.go-cqhttp.org/api/#%E8%8E%B7%E5%8F%96%E4%B8%AD%E6%96%87%E5%88%86%E8%AF%8D-%E9%9A%90%E8%97%8F-api @route(.get_word_slices)

func (*CQBot) CQGroupFileCreateFolder

func (bot *CQBot) CQGroupFileCreateFolder(groupID int64, parentID, name string) global.MSG

CQGroupFileCreateFolder 拓展API-创建群文件文件夹

@route(create_group_file_folder)

func (*CQBot) CQGroupFileDeleteFile

func (bot *CQBot) CQGroupFileDeleteFile(groupID int64, id string, busID int32) global.MSG

CQGroupFileDeleteFile 拓展API-删除群文件

@route(delete_group_file) @rename(id->file_id, bus_id->"[busid\x2Cbus_id].0")

func (*CQBot) CQGroupFileDeleteFolder

func (bot *CQBot) CQGroupFileDeleteFolder(groupID int64, id string) global.MSG

CQGroupFileDeleteFolder 拓展API-删除群文件文件夹

@route(delete_group_folder) @rename(id->folder_id)

func (*CQBot) CQHandleQuickOperation

func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) global.MSG

CQHandleQuickOperation 隐藏API-对事件执行快速操作

https://git.io/Jtz15 @route11(".handle_quick_operation")

func (*CQBot) CQMarkMessageAsRead

func (bot *CQBot) CQMarkMessageAsRead(msgID int32) global.MSG

CQMarkMessageAsRead 标记消息已读 @route(mark_msg_as_read) @rename(msg_id->message_id)

func (*CQBot) CQModifyRoleInGuild

func (bot *CQBot) CQModifyRoleInGuild(guildID uint64, roleID uint64, name string, color uint32, indepedent bool) global.MSG

CQModifyRoleInGuild 修改频道角色 @route(update_guild_role)

func (*CQBot) CQOcrImage

func (bot *CQBot) CQOcrImage(imageID string) global.MSG

CQOcrImage 扩展API-图片OCR

https://docs.go-cqhttp.org/api/#%E5%9B%BE%E7%89%87-ocr @route(ocr_image,".ocr_image") @rename(image_id->image)

func (*CQBot) CQProcessFriendRequest

func (bot *CQBot) CQProcessFriendRequest(flag string, approve bool) global.MSG

CQProcessFriendRequest 处理加好友请求

https://git.io/Jtz11 @route(set_friend_add_request) @default(approve=true)

func (*CQBot) CQProcessGroupRequest

func (bot *CQBot) CQProcessGroupRequest(flag, subType, reason string, approve bool) global.MSG

CQProcessGroupRequest 处理加群请求/邀请

https://git.io/Jtz1D @route(set_group_add_request) @rename(sub_type->"[sub_type\x2Ctype].0") @default(approve=true)

func (*CQBot) CQReloadEventFilter

func (bot *CQBot) CQReloadEventFilter(file string) global.MSG

CQReloadEventFilter 重载事件过滤器

@route(reload_event_filter)

func (*CQBot) CQSendForwardMessage

func (bot *CQBot) CQSendForwardMessage(groupID, userID int64, m gjson.Result, messageType string) global.MSG

CQSendForwardMessage 发送合并转发消息

@route11(send_forward_msg) @rename(m->messages)

func (*CQBot) CQSendGroupForwardMessage

func (bot *CQBot) CQSendGroupForwardMessage(groupID int64, m gjson.Result) global.MSG

CQSendGroupForwardMessage 扩展API-发送合并转发(群)

https://docs.go-cqhttp.org/api/#%E5%8F%91%E9%80%81%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91-%E7%BE%A4 @route11(send_group_forward_msg) @rename(m->messages)

func (*CQBot) CQSendGroupMessage

func (bot *CQBot) CQSendGroupMessage(groupID int64, m gjson.Result, autoEscape bool) global.MSG

CQSendGroupMessage 发送群消息

https://git.io/Jtz1c @route11(send_group_msg) @rename(m->message)

func (*CQBot) CQSendGroupSign

func (bot *CQBot) CQSendGroupSign(groupID int64) global.MSG

CQSendGroupSign 群打卡

https://club.vip.qq.com/onlinestatus/set @route(send_group_sign)

func (*CQBot) CQSendGuildChannelMessage

func (bot *CQBot) CQSendGuildChannelMessage(guildID, channelID uint64, m gjson.Result, autoEscape bool) global.MSG

CQSendGuildChannelMessage 发送频道消息

@route(send_guild_channel_msg) @rename(m->message)

func (*CQBot) CQSendMessage

func (bot *CQBot) CQSendMessage(groupID, userID int64, m gjson.Result, messageType string, autoEscape bool) global.MSG

CQSendMessage 发送消息

@route11(send_msg) @rename(m->message)

func (*CQBot) CQSendMessageV12

func (bot *CQBot) CQSendMessageV12(groupID, userID, detailType string, m gjson.Result) global.MSG

CQSendMessageV12 发送消息

@route12(send_message) @rename(m->message)

func (*CQBot) CQSendPrivateForwardMessage

func (bot *CQBot) CQSendPrivateForwardMessage(userID int64, m gjson.Result) global.MSG

CQSendPrivateForwardMessage 扩展API-发送合并转发(好友)

https://docs.go-cqhttp.org/api/#%E5%8F%91%E9%80%81%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91-%E7%BE%A4 @route11(send_private_forward_msg) @rename(m->messages)

func (*CQBot) CQSendPrivateMessage

func (bot *CQBot) CQSendPrivateMessage(userID int64, groupID int64, m gjson.Result, autoEscape bool) global.MSG

CQSendPrivateMessage 发送私聊消息

https://git.io/Jtz1l @route11(send_private_msg) @rename(m->message)

func (*CQBot) CQSendQidianTempMessage

func (bot *CQBot) CQSendQidianTempMessage(userID int64, groupID int64, m gjson.Result, autoEscape bool) global.MSG

CQSendQidianTempMessage 发送企点临时消息

https://git.io/Jtz1c @route11(send_qidian_msg) @rename(m->message)

func (*CQBot) CQSetEssenceMessage

func (bot *CQBot) CQSetEssenceMessage(messageID int32) global.MSG

CQSetEssenceMessage 扩展API-设置精华消息

https://docs.go-cqhttp.org/api/#%E8%AE%BE%E7%BD%AE%E7%B2%BE%E5%8D%8E%E6%B6%88%E6%81%AF @route(set_essence_msg)

func (*CQBot) CQSetGroupAdmin

func (bot *CQBot) CQSetGroupAdmin(groupID, userID int64, enable bool) global.MSG

CQSetGroupAdmin 群组设置管理员

https://git.io/Jtz1S @route(set_group_admin) @default(enable=true)

func (*CQBot) CQSetGroupAnonymous

func (bot *CQBot) CQSetGroupAnonymous(groupID int64, enable bool) global.MSG

CQSetGroupAnonymous 群组匿名

https://beautyyu.one @route(set_group_anonymous) @default(enable=true)

func (*CQBot) CQSetGroupAnonymousBan

func (bot *CQBot) CQSetGroupAnonymousBan(groupID int64, flag string, duration int32) global.MSG

CQSetGroupAnonymousBan 群组匿名用户禁言

https://git.io/Jtz1p @route(set_group_anonymous_ban) @rename(flag->"[anonymous_flag\x2Canonymous.flag].0")

func (*CQBot) CQSetGroupBan

func (bot *CQBot) CQSetGroupBan(groupID, userID int64, duration uint32) global.MSG

CQSetGroupBan 群组单人禁言

https://git.io/Jtz1w @route(set_group_ban) @default(duration=1800)

func (*CQBot) CQSetGroupCard

func (bot *CQBot) CQSetGroupCard(groupID, userID int64, card string) global.MSG

CQSetGroupCard 设置群名片(群备注)

https://git.io/Jtz1B @route(set_group_card)

func (*CQBot) CQSetGroupKick

func (bot *CQBot) CQSetGroupKick(groupID int64, userID int64, msg string, block bool) global.MSG

CQSetGroupKick 群组踢人

https://git.io/Jtz1V @route(set_group_kick) @rename(msg->message, block->reject_add_request)

func (*CQBot) CQSetGroupLeave

func (bot *CQBot) CQSetGroupLeave(groupID int64) global.MSG

CQSetGroupLeave 退出群组

https://git.io/Jtz1K @route(set_group_leave)

func (*CQBot) CQSetGroupMemo

func (bot *CQBot) CQSetGroupMemo(groupID int64, msg, img string) global.MSG

CQSetGroupMemo 扩展API-发送群公告

https://docs.go-cqhttp.org/api/#%E5%8F%91%E9%80%81%E7%BE%A4%E5%85%AC%E5%91%8A @route(_send_group_notice) @rename(msg->content, img->image)

func (*CQBot) CQSetGroupName

func (bot *CQBot) CQSetGroupName(groupID int64, name string) global.MSG

CQSetGroupName 设置群名

https://git.io/Jtz12 @route(set_group_name) @rename(name->group_name)

func (*CQBot) CQSetGroupPortrait

func (bot *CQBot) CQSetGroupPortrait(groupID int64, file, cache string) global.MSG

CQSetGroupPortrait 扩展API-设置群头像

https://docs.go-cqhttp.org/api/#%E8%AE%BE%E7%BD%AE%E7%BE%A4%E5%A4%B4%E5%83%8F @route(set_group_portrait)

func (*CQBot) CQSetGroupSpecialTitle

func (bot *CQBot) CQSetGroupSpecialTitle(groupID, userID int64, title string) global.MSG

CQSetGroupSpecialTitle 设置群组专属头衔

https://git.io/Jtz10 @route(set_group_special_title) @rename(title->special_title)

func (*CQBot) CQSetGroupWholeBan

func (bot *CQBot) CQSetGroupWholeBan(groupID int64, enable bool) global.MSG

CQSetGroupWholeBan 群组全员禁言

https://git.io/Jtz1o @route(set_group_whole_ban) @default(enable=true)

func (*CQBot) CQSetGuildMemberRole

func (bot *CQBot) CQSetGuildMemberRole(guildID uint64, set bool, roleID uint64, users gjson.Result) global.MSG

CQSetGuildMemberRole 设置用户在频道中的角色 @route(set_guild_member_role)

func (*CQBot) CQSetModelShow

func (bot *CQBot) CQSetModelShow(model, modelShow string) global.MSG

CQSetModelShow 设置在线机型

https://club.vip.qq.com/onlinestatus/set @route(_set_model_show)

func (*CQBot) CQSetQQProfile

func (bot *CQBot) CQSetQQProfile(nickname, company, email, college, personalNote gjson.Result) global.MSG

CQSetQQProfile 设置 QQ 资料

@route(set_qq_profile)

func (*CQBot) CQUploadGroupFile

func (bot *CQBot) CQUploadGroupFile(groupID int64, file, name, folder string) global.MSG

CQUploadGroupFile 扩展API-上传群文件

https://docs.go-cqhttp.org/api/#%E4%B8%8A%E4%BC%A0%E7%BE%A4%E6%96%87%E4%BB%B6 @route(upload_group_file)

func (*CQBot) CQUploadPrivateFile

func (bot *CQBot) CQUploadPrivateFile(userID int64, file, name string) global.MSG

CQUploadPrivateFile 扩展API-上传私聊文件

@route(upload_private_file)

func (*CQBot) ConvertContentMessage

func (bot *CQBot) ConvertContentMessage(content []global.MSG, sourceType message.SourceType, noReply bool) (r []message.IMessageElement)

ConvertContentMessage 将数据库用的 content 转换为消息元素数组

func (*CQBot) ConvertElement

func (bot *CQBot) ConvertElement(spec *onebot.Spec, elem msg.Element, sourceType message.SourceType) (m any, err error)

ConvertElement 将解码后的消息转换为MiraiGoElement.

返回 interface{} 存在三种类型

message.IMessageElement []message.IMessageElement nil

func (*CQBot) ConvertElements

func (bot *CQBot) ConvertElements(spec *onebot.Spec, elems []msg.Element, sourceType message.SourceType, noReply bool) (r []message.IMessageElement)

ConvertElements 将解码后的消息数组转换为MiraiGo表示

func (*CQBot) ConvertObjectMessage

func (bot *CQBot) ConvertObjectMessage(spec *onebot.Spec, m gjson.Result, sourceType message.SourceType) (r []message.IMessageElement)

ConvertObjectMessage 将消息JSON对象转为消息元素数组

func (*CQBot) ConvertStringMessage

func (bot *CQBot) ConvertStringMessage(spec *onebot.Spec, raw string, sourceType message.SourceType) (r []message.IMessageElement)

ConvertStringMessage 将消息字符串转为消息元素数组

func (*CQBot) InsertGroupMessage

func (bot *CQBot) InsertGroupMessage(m *message.GroupMessage, source message.Source) int32

InsertGroupMessage 群聊消息入数据库

func (*CQBot) InsertGuildChannelMessage

func (bot *CQBot) InsertGuildChannelMessage(m *message.GuildChannelMessage) string

InsertGuildChannelMessage 频道消息入数据库

func (*CQBot) InsertPrivateMessage

func (bot *CQBot) InsertPrivateMessage(m *message.PrivateMessage, source message.Source) int32

InsertPrivateMessage 私聊消息入数据库

func (*CQBot) OnEventPush

func (bot *CQBot) OnEventPush(f func(e *Event))

OnEventPush 注册事件上报函数

func (*CQBot) SendGroupMessage

func (bot *CQBot) SendGroupMessage(groupID int64, m *message.SendingMessage) (int32, error)

SendGroupMessage 发送群消息

func (*CQBot) SendGuildChannelMessage

func (bot *CQBot) SendGuildChannelMessage(guildID, channelID uint64, m *message.SendingMessage) string

SendGuildChannelMessage 发送频道消息

func (*CQBot) SendPrivateMessage

func (bot *CQBot) SendPrivateMessage(target int64, groupID int64, m *message.SendingMessage) int32

SendPrivateMessage 发送私聊消息

type Event

type Event struct {
	Raw *event
	// contains filtered or unexported fields
}

Event 事件

func (*Event) JSONBytes

func (e *Event) JSONBytes() []byte

JSONBytes return byes of json by lazy marshalling.

func (*Event) JSONString

func (e *Event) JSONString() string

JSONString return string of json without extra allocation by lazy marshalling.

Jump to

Keyboard shortcuts

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