Documentation ¶
Overview ¶
Package coolq 包含CQBot实例,CQ码处理,消息发送,消息处理等的相关函数与结构体
Index ¶
- func Failed(code int, msg ...string) global.MSG
- func FeedContentsToArrayMessage(contents []topic.IFeedRichContentElement) []global.MSG
- func OK(data any) global.MSG
- func ToFormattedMessage(e []message.IMessageElement, source message.Source) (r any)
- func ToMessageContent(e []message.IMessageElement, source message.Source) (r []global.MSG)
- type CQBot
- func (bot *CQBot) CQCanSendImage() global.MSG
- func (bot *CQBot) CQCanSendRecord() global.MSG
- func (bot *CQBot) CQCheckURLSafely(url string) global.MSG
- func (bot *CQBot) CQCreateGuildRole(guildID uint64, name string, color uint32, independent bool, ...) global.MSG
- func (bot *CQBot) CQDelGroupMemo(groupID int64, fid string) global.MSG
- func (bot *CQBot) CQDeleteEssenceMessage(messageID int32) global.MSG
- func (bot *CQBot) CQDeleteFriend(uin int64) global.MSG
- func (bot *CQBot) CQDeleteGuildRole(guildID uint64, roleID uint64) global.MSG
- func (bot *CQBot) CQDeleteMessage(messageID int32) global.MSG
- func (bot *CQBot) CQDeleteUnidirectionalFriend(uin int64) global.MSG
- func (bot *CQBot) CQDownloadFile(url string, headers gjson.Result, threadCount int) global.MSG
- func (bot *CQBot) CQGetAtAllRemain(groupID int64) global.MSG
- func (bot *CQBot) CQGetEssenceMessageList(groupID int64) global.MSG
- func (bot *CQBot) CQGetForwardMessage(resID string) global.MSG
- func (bot *CQBot) CQGetFriendList(spec *onebot.Spec) global.MSG
- func (bot *CQBot) CQGetGroupFileSystemInfo(groupID int64) global.MSG
- func (bot *CQBot) CQGetGroupFileURL(groupID int64, fileID string, busID int32) global.MSG
- func (bot *CQBot) CQGetGroupFilesByFolderID(groupID int64, folderID string) global.MSG
- func (bot *CQBot) CQGetGroupHonorInfo(groupID int64, t string) global.MSG
- func (bot *CQBot) CQGetGroupInfo(groupID int64, noCache bool, spec *onebot.Spec) global.MSG
- func (bot *CQBot) CQGetGroupList(noCache bool, spec *onebot.Spec) global.MSG
- func (bot *CQBot) CQGetGroupMemberInfo(groupID, userID int64, noCache bool) global.MSG
- func (bot *CQBot) CQGetGroupMemberList(groupID int64, noCache bool) global.MSG
- func (bot *CQBot) CQGetGroupMemo(groupID int64) global.MSG
- func (bot *CQBot) CQGetGroupMessageHistory(groupID int64, seq int64) global.MSG
- func (bot *CQBot) CQGetGroupRootFiles(groupID int64) global.MSG
- func (bot *CQBot) CQGetGroupSystemMessages() global.MSG
- func (bot *CQBot) CQGetGuildChannelList(guildID uint64, noCache bool) global.MSG
- func (bot *CQBot) CQGetGuildList() global.MSG
- func (bot *CQBot) CQGetGuildMemberProfile(guildID, userID uint64) global.MSG
- func (bot *CQBot) CQGetGuildMembers(guildID uint64, nextToken string) global.MSG
- func (bot *CQBot) CQGetGuildMessage(messageID string, noCache bool) global.MSG
- func (bot *CQBot) CQGetGuildMetaByGuest(guildID uint64) global.MSG
- func (bot *CQBot) CQGetGuildRoles(guildID uint64) global.MSG
- func (bot *CQBot) CQGetGuildServiceProfile() global.MSG
- func (bot *CQBot) CQGetImage(file string) global.MSG
- func (bot *CQBot) CQGetLoginInfo() global.MSG
- func (bot *CQBot) CQGetMessage(messageID int32) global.MSG
- func (bot *CQBot) CQGetModelShow(model string) global.MSG
- func (bot *CQBot) CQGetOnlineClients(noCache bool) global.MSG
- func (bot *CQBot) CQGetQiDianAccountInfo() global.MSG
- func (bot *CQBot) CQGetStatus(spec *onebot.Spec) global.MSG
- func (bot *CQBot) CQGetStrangerInfo(userID int64) global.MSG
- func (bot *CQBot) CQGetSupportedActions(spec *onebot.Spec) global.MSG
- func (bot *CQBot) CQGetTopicChannelFeeds(guildID, channelID uint64) global.MSG
- func (bot *CQBot) CQGetUnidirectionalFriendList() global.MSG
- func (bot *CQBot) CQGetVersion() global.MSG
- func (bot *CQBot) CQGetVersionInfo() global.MSG
- func (bot *CQBot) CQGetWordSlices(content string) global.MSG
- func (bot *CQBot) CQGroupFileCreateFolder(groupID int64, parentID, name string) global.MSG
- func (bot *CQBot) CQGroupFileDeleteFile(groupID int64, id string, busID int32) global.MSG
- func (bot *CQBot) CQGroupFileDeleteFolder(groupID int64, id string) global.MSG
- func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) global.MSG
- func (bot *CQBot) CQMarkMessageAsRead(msgID int32) global.MSG
- func (bot *CQBot) CQModifyRoleInGuild(guildID uint64, roleID uint64, name string, color uint32, indepedent bool) global.MSG
- func (bot *CQBot) CQOcrImage(imageID string) global.MSG
- func (bot *CQBot) CQProcessFriendRequest(flag string, approve bool) global.MSG
- func (bot *CQBot) CQProcessGroupRequest(flag, subType, reason string, approve bool) global.MSG
- func (bot *CQBot) CQReloadEventFilter(file string) global.MSG
- func (bot *CQBot) CQSendForwardMessage(groupID, userID int64, m gjson.Result, messageType string) global.MSG
- func (bot *CQBot) CQSendGroupForwardMessage(groupID int64, m gjson.Result) global.MSG
- func (bot *CQBot) CQSendGroupMessage(groupID int64, m gjson.Result, autoEscape bool) global.MSG
- func (bot *CQBot) CQSendGroupSign(groupID int64) global.MSG
- func (bot *CQBot) CQSendGuildChannelMessage(guildID, channelID uint64, m gjson.Result, autoEscape bool) global.MSG
- func (bot *CQBot) CQSendMessage(groupID, userID int64, m gjson.Result, messageType string, autoEscape bool) global.MSG
- func (bot *CQBot) CQSendMessageV12(groupID, userID, detailType string, m gjson.Result) global.MSG
- func (bot *CQBot) CQSendPrivateForwardMessage(userID int64, m gjson.Result) global.MSG
- func (bot *CQBot) CQSendPrivateMessage(userID int64, groupID int64, m gjson.Result, autoEscape bool) global.MSG
- func (bot *CQBot) CQSendQidianTempMessage(userID int64, groupID int64, m gjson.Result, autoEscape bool) global.MSG
- func (bot *CQBot) CQSetEssenceMessage(messageID int32) global.MSG
- func (bot *CQBot) CQSetGroupAdmin(groupID, userID int64, enable bool) global.MSG
- func (bot *CQBot) CQSetGroupAnonymous(groupID int64, enable bool) global.MSG
- func (bot *CQBot) CQSetGroupAnonymousBan(groupID int64, flag string, duration int32) global.MSG
- func (bot *CQBot) CQSetGroupBan(groupID, userID int64, duration uint32) global.MSG
- func (bot *CQBot) CQSetGroupCard(groupID, userID int64, card string) global.MSG
- func (bot *CQBot) CQSetGroupKick(groupID int64, userID int64, msg string, block bool) global.MSG
- func (bot *CQBot) CQSetGroupLeave(groupID int64) global.MSG
- func (bot *CQBot) CQSetGroupMemo(groupID int64, msg, img string) global.MSG
- func (bot *CQBot) CQSetGroupName(groupID int64, name string) global.MSG
- func (bot *CQBot) CQSetGroupPortrait(groupID int64, file, cache string) global.MSG
- func (bot *CQBot) CQSetGroupSpecialTitle(groupID, userID int64, title string) global.MSG
- func (bot *CQBot) CQSetGroupWholeBan(groupID int64, enable bool) global.MSG
- func (bot *CQBot) CQSetGuildMemberRole(guildID uint64, set bool, roleID uint64, users gjson.Result) global.MSG
- func (bot *CQBot) CQSetModelShow(model, modelShow string) global.MSG
- func (bot *CQBot) CQSetQQProfile(nickname, company, email, college, personalNote gjson.Result) global.MSG
- func (bot *CQBot) CQUploadGroupFile(groupID int64, file, name, folder string) global.MSG
- func (bot *CQBot) CQUploadPrivateFile(userID int64, file, name string) global.MSG
- func (bot *CQBot) ConvertContentMessage(content []global.MSG, sourceType message.SourceType, noReply bool) (r []message.IMessageElement)
- func (bot *CQBot) ConvertElement(spec *onebot.Spec, elem msg.Element, sourceType message.SourceType) (m any, err error)
- func (bot *CQBot) ConvertElements(spec *onebot.Spec, elems []msg.Element, sourceType message.SourceType, ...) (r []message.IMessageElement)
- func (bot *CQBot) ConvertObjectMessage(spec *onebot.Spec, m gjson.Result, sourceType message.SourceType) (r []message.IMessageElement)
- func (bot *CQBot) ConvertStringMessage(spec *onebot.Spec, raw string, sourceType message.SourceType) (r []message.IMessageElement)
- func (bot *CQBot) InsertGroupMessage(m *message.GroupMessage, source message.Source) int32
- func (bot *CQBot) InsertGuildChannelMessage(m *message.GuildChannelMessage) string
- func (bot *CQBot) InsertPrivateMessage(m *message.PrivateMessage, source message.Source) int32
- func (bot *CQBot) OnEventPush(f func(e *Event))
- func (bot *CQBot) SendGroupMessage(groupID int64, m *message.SendingMessage) (int32, error)
- func (bot *CQBot) SendGuildChannelMessage(guildID, channelID uint64, m *message.SendingMessage) string
- func (bot *CQBot) SendPrivateMessage(target int64, groupID int64, m *message.SendingMessage) int32
- type Event
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FeedContentsToArrayMessage ¶
func FeedContentsToArrayMessage(contents []topic.IFeedRichContentElement) []global.MSG
FeedContentsToArrayMessage 将话题频道帖子内容转换为 Array Message
func ToFormattedMessage ¶
func ToFormattedMessage(e []message.IMessageElement, source message.Source) (r any)
ToFormattedMessage 将给定[]message.IMessageElement转换为通过coolq.SetMessageFormat所定义的消息上报格式
func ToMessageContent ¶
ToMessageContent 将消息转换成 Content. 忽略 Reply 不同于 onebot 的 Array Message, 此函数转换出来的 Content 的 data 段为实际类型 方便数据库查询
Types ¶
type CQBot ¶
CQBot CQBot结构体,存储Bot实例相关配置
func (*CQBot) CQCanSendImage ¶
CQCanSendImage 检查是否可以发送图片(此处永远返回true)
https://git.io/Jtz1N @route11(can_send_image)
func (*CQBot) CQCanSendRecord ¶
CQCanSendRecord 检查是否可以发送语音(此处永远返回true)
https://git.io/Jtz1x @route11(can_send_record)
func (*CQBot) CQCheckURLSafely ¶
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 ¶
CQDelGroupMemo 扩展API-删除群公告 @route(_del_group_notice) @rename(fid->notice_id)
func (*CQBot) CQDeleteEssenceMessage ¶
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 ¶
CQDeleteFriend 删除好友 @route(delete_friend) @rename(uin->"[user_id\x2Cid].0")
func (*CQBot) CQDeleteGuildRole ¶
CQDeleteGuildRole 删除频道角色 @route(delete_guild_role)
func (*CQBot) CQDeleteUnidirectionalFriend ¶
CQDeleteUnidirectionalFriend 删除单向好友
@route(delete_unidirectional_friend) @rename(uin->user_id)
func (*CQBot) CQDownloadFile ¶
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 ¶
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 ¶
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 ¶
CQGetForwardMessage 获取合并转发消息
https://git.io/Jtz1F @route(get_forward_msg) @rename(res_id->"[message_id\x2Cid].0")
func (*CQBot) CQGetGroupFileSystemInfo ¶
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 ¶
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 ¶
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 ¶
CQGetGroupHonorInfo 获取群荣誉信息
https://git.io/Jtz1H @route(get_group_honor_info) @rename(t->type)
func (*CQBot) CQGetGroupMemberInfo ¶
CQGetGroupMemberInfo 获取群成员信息
https://git.io/Jtz1s @route(get_group_member_info)
func (*CQBot) CQGetGroupMemberList ¶
CQGetGroupMemberList 获取群成员列表
https://git.io/Jtz13 @route(get_group_member_list)
func (*CQBot) CQGetGroupMemo ¶
CQGetGroupMemo 扩展API-获取群公告 @route(_get_group_notice)
func (*CQBot) CQGetGroupMessageHistory ¶
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 ¶
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 ¶
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 ¶
CQGetGuildChannelList 获取频道列表 @route(get_guild_channel_list)
func (*CQBot) CQGetGuildList ¶
CQGetGuildList 获取已加入的频道列表 @route(get_guild_list)
func (*CQBot) CQGetGuildMemberProfile ¶
CQGetGuildMemberProfile 获取频道成员资料 @route(get_guild_member_profile)
func (*CQBot) CQGetGuildMembers ¶
CQGetGuildMembers 获取频道成员列表 @route(get_guild_member_list)
func (*CQBot) CQGetGuildMessage ¶
CQGetGuildMessage 获取频道消息 @route(get_guild_msg)
func (*CQBot) CQGetGuildMetaByGuest ¶
CQGetGuildMetaByGuest 通过访客权限获取频道元数据 @route(get_guild_meta_by_guest)
func (*CQBot) CQGetGuildRoles ¶
CQGetGuildRoles 获取频道角色列表 @route(get_guild_roles)
func (*CQBot) CQGetGuildServiceProfile ¶
CQGetGuildServiceProfile 获取频道系统个人资料 @route(get_guild_service_profile)
func (*CQBot) CQGetImage ¶
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 ¶
CQGetLoginInfo 获取登录号信息
https://git.io/Jtz1I @route11(get_login_info) @route12(get_self_info)
func (*CQBot) CQGetModelShow ¶
CQGetModelShow 获取在线机型
https://club.vip.qq.com/onlinestatus/set @route(_get_model_show)
func (*CQBot) CQGetOnlineClients ¶
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 ¶
CQGetQiDianAccountInfo 获取企点账号信息 @route(qidian_get_account_info)
func (*CQBot) CQGetStrangerInfo ¶
CQGetStrangerInfo 获取陌生人信息
https://git.io/Jtz17 @route11(get_stranger_info) @route12(get_user_info)
func (*CQBot) CQGetTopicChannelFeeds ¶
CQGetTopicChannelFeeds 获取话题频道帖子列表 @route(get_topic_channel_feeds)
func (*CQBot) CQGetUnidirectionalFriendList ¶
CQGetUnidirectionalFriendList 获取单向好友列表
@route(get_unidirectional_friend_list)
func (*CQBot) CQGetVersion ¶
CQGetVersion 获取版本信息 OneBotV12
https://git.io/JtwUs @route12(get_version)
func (*CQBot) CQGetVersionInfo ¶
CQGetVersionInfo 获取版本信息
https://git.io/JtwUs @route11(get_version_info)
func (*CQBot) CQGetWordSlices ¶
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 ¶
CQGroupFileCreateFolder 拓展API-创建群文件文件夹
@route(create_group_file_folder)
func (*CQBot) CQGroupFileDeleteFile ¶
CQGroupFileDeleteFile 拓展API-删除群文件
@route(delete_group_file) @rename(id->file_id, bus_id->"[busid\x2Cbus_id].0")
func (*CQBot) CQGroupFileDeleteFolder ¶
CQGroupFileDeleteFolder 拓展API-删除群文件文件夹
@route(delete_group_folder) @rename(id->folder_id)
func (*CQBot) CQHandleQuickOperation ¶
CQHandleQuickOperation 隐藏API-对事件执行快速操作
https://git.io/Jtz15 @route11(".handle_quick_operation")
func (*CQBot) CQMarkMessageAsRead ¶
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 ¶
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 ¶
CQProcessFriendRequest 处理加好友请求
https://git.io/Jtz11 @route(set_friend_add_request) @default(approve=true)
func (*CQBot) CQProcessGroupRequest ¶
CQProcessGroupRequest 处理加群请求/邀请
https://git.io/Jtz1D @route(set_group_add_request) @rename(sub_type->"[sub_type\x2Ctype].0") @default(approve=true)
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 ¶
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 ¶
CQSendGroupMessage 发送群消息
https://git.io/Jtz1c @route11(send_group_msg) @rename(m->message)
func (*CQBot) CQSendGroupSign ¶
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) CQSendPrivateForwardMessage ¶
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 ¶
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 ¶
CQSetGroupAdmin 群组设置管理员
https://git.io/Jtz1S @route(set_group_admin) @default(enable=true)
func (*CQBot) CQSetGroupAnonymous ¶
CQSetGroupAnonymous 群组匿名
https://beautyyu.one @route(set_group_anonymous) @default(enable=true)
func (*CQBot) CQSetGroupAnonymousBan ¶
CQSetGroupAnonymousBan 群组匿名用户禁言
https://git.io/Jtz1p @route(set_group_anonymous_ban) @rename(flag->"[anonymous_flag\x2Canonymous.flag].0")
func (*CQBot) CQSetGroupBan ¶
CQSetGroupBan 群组单人禁言
https://git.io/Jtz1w @route(set_group_ban) @default(duration=1800)
func (*CQBot) CQSetGroupCard ¶
CQSetGroupCard 设置群名片(群备注)
https://git.io/Jtz1B @route(set_group_card)
func (*CQBot) CQSetGroupKick ¶
CQSetGroupKick 群组踢人
https://git.io/Jtz1V @route(set_group_kick) @rename(msg->message, block->reject_add_request)
func (*CQBot) CQSetGroupMemo ¶
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 ¶
CQSetGroupName 设置群名
https://git.io/Jtz12 @route(set_group_name) @rename(name->group_name)
func (*CQBot) CQSetGroupPortrait ¶
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 ¶
CQSetGroupSpecialTitle 设置群组专属头衔
https://git.io/Jtz10 @route(set_group_special_title) @rename(title->special_title)
func (*CQBot) CQSetGroupWholeBan ¶
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 ¶
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 ¶
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) 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 ¶
InsertGroupMessage 群聊消息入数据库
func (*CQBot) InsertGuildChannelMessage ¶
func (bot *CQBot) InsertGuildChannelMessage(m *message.GuildChannelMessage) string
InsertGuildChannelMessage 频道消息入数据库
func (*CQBot) InsertPrivateMessage ¶
InsertPrivateMessage 私聊消息入数据库
func (*CQBot) SendGroupMessage ¶
SendGroupMessage 发送群消息
func (*CQBot) SendGuildChannelMessage ¶
func (bot *CQBot) SendGuildChannelMessage(guildID, channelID uint64, m *message.SendingMessage) string
SendGuildChannelMessage 发送频道消息
func (*CQBot) SendPrivateMessage ¶
SendPrivateMessage 发送私聊消息