Documentation ¶
Index ¶
- Variables
- func CQCodeEscapeText(raw string) string
- func CQCodeEscapeValue(value string) string
- func CQCodeUnescapeText(content string) string
- func CQCodeUnescapeValue(content string) string
- func SetMessageFormat(f string)
- func ToFormattedMessage(e []message.IMessageElement, id int64, raw ...bool) (r interface{})
- func ToGlobalId(code int64, msgId int32) int32
- func ToStringMessage(e []message.IMessageElement, code int64, raw ...bool) (r string)
- func XmlEscape(c string) string
- type CQBot
- func (bot *CQBot) CQCanSendImage() MSG
- func (bot *CQBot) CQCanSendRecord() MSG
- func (bot *CQBot) CQDeleteMessage(messageId int32) MSG
- func (bot *CQBot) CQDownloadFile(url string, headers map[string]string, threadCount int) MSG
- func (bot *CQBot) CQGetAtAllRemain(groupId int64) MSG
- func (bot *CQBot) CQGetForwardMessage(resId string) MSG
- func (bot *CQBot) CQGetFriendList() MSG
- func (bot *CQBot) CQGetGroupFileSystemInfo(groupId int64) MSG
- func (bot *CQBot) CQGetGroupFileUrl(groupId int64, fileId string, busId int32) MSG
- func (bot *CQBot) CQGetGroupFilesByFolderId(groupId int64, folderId string) MSG
- func (bot *CQBot) CQGetGroupHonorInfo(groupId int64, t string) MSG
- func (bot *CQBot) CQGetGroupInfo(groupId int64, noCache bool) MSG
- func (bot *CQBot) CQGetGroupList(noCache bool) MSG
- func (bot *CQBot) CQGetGroupMemberInfo(groupId, userId int64) MSG
- func (bot *CQBot) CQGetGroupMemberList(groupId int64, noCache bool) MSG
- func (bot *CQBot) CQGetGroupMessageHistory(groupId int64, seq int64) MSG
- func (bot *CQBot) CQGetGroupRootFiles(groupId int64) MSG
- func (bot *CQBot) CQGetGroupSystemMessages() MSG
- func (bot *CQBot) CQGetImage(file string) MSG
- func (bot *CQBot) CQGetLoginInfo() MSG
- func (bot *CQBot) CQGetMessage(messageId int32) MSG
- func (bot *CQBot) CQGetOnlineClients(noCache bool) MSG
- func (bot *CQBot) CQGetStatus() MSG
- func (bot *CQBot) CQGetStrangerInfo(userId int64) MSG
- func (bot *CQBot) CQGetVersionInfo() MSG
- func (bot *CQBot) CQGetVipInfo(userId int64) MSG
- func (bot *CQBot) CQGetWordSlices(content string) MSG
- func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) MSG
- func (bot *CQBot) CQOcrImage(imageId string) MSG
- func (bot *CQBot) CQProcessFriendRequest(flag string, approve bool) MSG
- func (bot *CQBot) CQProcessGroupRequest(flag, subType, reason string, approve bool) MSG
- func (bot *CQBot) CQReloadEventFilter() MSG
- func (bot *CQBot) CQSendGroupForwardMessage(groupId int64, m gjson.Result) MSG
- func (bot *CQBot) CQSendGroupMessage(groupId int64, i interface{}, autoEscape bool) MSG
- func (bot *CQBot) CQSendPrivateMessage(userId int64, i interface{}, autoEscape bool) MSG
- func (bot *CQBot) CQSetGroupAdmin(groupId, userId int64, enable bool) MSG
- func (bot *CQBot) CQSetGroupAnonymousBan(groupId int64, flag string, duration int32) MSG
- func (bot *CQBot) CQSetGroupBan(groupId, userId int64, duration uint32) MSG
- func (bot *CQBot) CQSetGroupCard(groupId, userId int64, card string) MSG
- func (bot *CQBot) CQSetGroupKick(groupId, userId int64, msg string, block bool) MSG
- func (bot *CQBot) CQSetGroupLeave(groupId int64) MSG
- func (bot *CQBot) CQSetGroupMemo(groupId int64, msg string) MSG
- func (bot *CQBot) CQSetGroupName(groupId int64, name string) MSG
- func (bot *CQBot) CQSetGroupPortrait(groupId int64, file, cache string) MSG
- func (bot *CQBot) CQSetGroupSpecialTitle(groupId, userId int64, title string) MSG
- func (bot *CQBot) CQSetGroupWholeBan(groupId int64, enable bool) MSG
- func (bot *CQBot) ConvertObjectMessage(m gjson.Result, group bool) (r []message.IMessageElement)
- func (bot *CQBot) ConvertStringMessage(msg string, group bool) (r []message.IMessageElement)
- func (bot *CQBot) GetMessage(mid int32) MSG
- func (bot *CQBot) InsertGroupMessage(m *message.GroupMessage) int32
- func (bot *CQBot) InsertPrivateMessage(m *message.PrivateMessage) int32
- func (bot *CQBot) OnEventPush(f func(m MSG))
- func (bot *CQBot) Release()
- func (bot *CQBot) SendGroupMessage(groupId int64, m *message.SendingMessage) int32
- func (bot *CQBot) SendPrivateMessage(target int64, m *message.SendingMessage) int32
- func (bot *CQBot) ToElement(t string, d map[string]string, group bool) (m interface{}, err error)
- func (bot *CQBot) UploadLocalImageAsGroup(groupCode int64, img *LocalImageElement) (*message.GroupImageElement, error)
- func (bot *CQBot) UploadLocalImageAsPrivate(userId int64, img *LocalImageElement) (*message.FriendImageElement, error)
- func (bot *CQBot) UploadLocalVideo(target int64, v *LocalVideoElement) (*message.ShortVideoElement, error)
- type CloudMusicElement
- type GiftElement
- type LocalImageElement
- type LocalVideoElement
- type LocalVoiceElement
- type MSG
- type MiguMusicElement
- type MusicElement
- type PokeElement
- type QQMusicElement
Constants ¶
This section is empty.
Variables ¶
var ForceFragmented = false
var GiftId = [...]message.GroupGift{ message.SweetWink, message.HappyCola, message.LuckyBracelet, message.Cappuccino, message.CatWatch, message.FleeceGloves, message.RainbowCandy, message.Stronger, message.LoveMicrophone, message.HoldingYourHand, message.CuteCat, message.MysteryMask, message.ImBusy, message.LoveMask, }
var IgnoreInvalidCQCode = false
var SplitUrl = false
var Version = "unknown"
Functions ¶
func CQCodeEscapeText ¶ added in v0.9.16
func CQCodeEscapeValue ¶ added in v0.9.18
func CQCodeUnescapeText ¶ added in v0.9.16
func CQCodeUnescapeValue ¶ added in v0.9.18
func SetMessageFormat ¶ added in v0.9.18
func SetMessageFormat(f string)
SetMessageFormat 设置消息上报格式,默认为string
func ToFormattedMessage ¶ added in v0.9.18
func ToFormattedMessage(e []message.IMessageElement, id int64, raw ...bool) (r interface{})
ToFormattedMessage 将给定[]message.IMessageElement转换为通过coolq.SetMessageFormat所定义的消息上报格式
func ToGlobalId ¶
func ToStringMessage ¶
func ToStringMessage(e []message.IMessageElement, code int64, raw ...bool) (r string)
Types ¶
type CQBot ¶
func (*CQBot) CQCanSendImage ¶
func (*CQBot) CQCanSendRecord ¶
func (*CQBot) CQDeleteMessage ¶
https://cqhttp.cc/docs/4.15/#/API?id=delete_msg-%E6%92%A4%E5%9B%9E%E6%B6%88%E6%81%AF
func (*CQBot) CQDownloadFile ¶ added in v0.9.38
func (*CQBot) CQGetAtAllRemain ¶ added in v0.9.35
func (*CQBot) CQGetForwardMessage ¶ added in v0.9.3
func (*CQBot) CQGetFriendList ¶
func (*CQBot) CQGetGroupFileSystemInfo ¶ added in v0.9.30
func (*CQBot) CQGetGroupFileUrl ¶ added in v0.9.30
func (*CQBot) CQGetGroupFilesByFolderId ¶ added in v0.9.30
func (*CQBot) CQGetGroupHonorInfo ¶ added in v0.9.20
func (*CQBot) CQGetGroupInfo ¶
https://cqhttp.cc/docs/4.15/#/API?id=get_group_info-%E8%8E%B7%E5%8F%96%E7%BE%A4%E4%BF%A1%E6%81%AF
func (*CQBot) CQGetGroupList ¶
https://cqhttp.cc/docs/4.15/#/API?id=get_group_list-%E8%8E%B7%E5%8F%96%E7%BE%A4%E5%88%97%E8%A1%A8
func (*CQBot) CQGetGroupMemberInfo ¶
func (*CQBot) CQGetGroupMemberList ¶
func (*CQBot) CQGetGroupMessageHistory ¶ added in v0.9.39
func (*CQBot) CQGetGroupRootFiles ¶ added in v0.9.30
func (*CQBot) CQGetGroupSystemMessages ¶ added in v0.9.30
func (*CQBot) CQGetImage ¶
func (*CQBot) CQGetLoginInfo ¶
func (*CQBot) CQGetMessage ¶ added in v0.9.29
func (*CQBot) CQGetOnlineClients ¶ added in v0.9.39
func (*CQBot) CQGetStatus ¶
func (*CQBot) CQGetStrangerInfo ¶ added in v0.9.26
func (*CQBot) CQGetVersionInfo ¶
func (*CQBot) CQGetVipInfo ¶ added in v0.9.24
func (*CQBot) CQGetWordSlices ¶ added in v0.9.27
func (*CQBot) CQHandleQuickOperation ¶ added in v0.9.1
https://cqhttp.cc/docs/4.15/#/API?id=-handle_quick_operation-%E5%AF%B9%E4%BA%8B%E4%BB%B6%E6%89%A7%E8%A1%8C%E5%BF%AB%E9%80%9F%E6%93%8D%E4%BD%9C https://github.com/richardchien/coolq-http-api/blob/master/src/cqhttp/plugins/web/http.cpp#L376
func (*CQBot) CQOcrImage ¶ added in v0.9.26
func (*CQBot) CQProcessFriendRequest ¶
func (*CQBot) CQProcessGroupRequest ¶
func (*CQBot) CQReloadEventFilter ¶ added in v0.9.25
func (*CQBot) CQSendGroupForwardMessage ¶ added in v0.9.4
func (*CQBot) CQSendGroupMessage ¶
https://cqhttp.cc/docs/4.15/#/API?id=send_group_msg-%E5%8F%91%E9%80%81%E7%BE%A4%E6%B6%88%E6%81%AF
func (*CQBot) CQSendPrivateMessage ¶
func (*CQBot) CQSetGroupAdmin ¶ added in v0.9.25
func (*CQBot) CQSetGroupAnonymousBan ¶ added in v0.9.36
func (*CQBot) CQSetGroupBan ¶
func (*CQBot) CQSetGroupCard ¶
func (*CQBot) CQSetGroupKick ¶
https://cqhttp.cc/docs/4.15/#/API?id=set_group_kick-%E7%BE%A4%E7%BB%84%E8%B8%A2%E4%BA%BA
func (*CQBot) CQSetGroupLeave ¶ added in v0.9.6
https://cqhttp.cc/docs/4.15/#/API?id=set_group_leave-%E9%80%80%E5%87%BA%E7%BE%A4%E7%BB%84
func (*CQBot) CQSetGroupMemo ¶ added in v0.9.24
func (*CQBot) CQSetGroupPortrait ¶ added in v0.9.26
func (*CQBot) CQSetGroupSpecialTitle ¶
func (*CQBot) CQSetGroupWholeBan ¶
func (*CQBot) ConvertObjectMessage ¶ added in v0.9.4
func (*CQBot) ConvertStringMessage ¶
func (bot *CQBot) ConvertStringMessage(msg string, group bool) (r []message.IMessageElement)
func (*CQBot) GetMessage ¶ added in v0.9.29
func (*CQBot) InsertGroupMessage ¶
func (bot *CQBot) InsertGroupMessage(m *message.GroupMessage) int32
func (*CQBot) InsertPrivateMessage ¶ added in v0.9.29
func (bot *CQBot) InsertPrivateMessage(m *message.PrivateMessage) int32
func (*CQBot) OnEventPush ¶
func (*CQBot) SendGroupMessage ¶
func (bot *CQBot) SendGroupMessage(groupId int64, m *message.SendingMessage) int32
func (*CQBot) SendPrivateMessage ¶
func (bot *CQBot) SendPrivateMessage(target int64, m *message.SendingMessage) int32
func (*CQBot) ToElement ¶
ToElement 将解码后的CQCode转换为Element. 返回 interface{} 存在三种类型 message.IMessageElement []message.IMessageElement nil
func (*CQBot) UploadLocalImageAsGroup ¶ added in v0.9.37
func (bot *CQBot) UploadLocalImageAsGroup(groupCode int64, img *LocalImageElement) (*message.GroupImageElement, error)
func (*CQBot) UploadLocalImageAsPrivate ¶ added in v0.9.37
func (bot *CQBot) UploadLocalImageAsPrivate(userId int64, img *LocalImageElement) (*message.FriendImageElement, error)
func (*CQBot) UploadLocalVideo ¶ added in v0.9.38
func (bot *CQBot) UploadLocalVideo(target int64, v *LocalVideoElement) (*message.ShortVideoElement, error)
type CloudMusicElement ¶ added in v0.9.28
type CloudMusicElement struct {
MusicElement
}
type GiftElement ¶ added in v0.9.27
func (*GiftElement) Type ¶ added in v0.9.27
func (e *GiftElement) Type() message.ElementType
type LocalImageElement ¶ added in v0.9.37
type LocalImageElement struct { message.ImageElement Stream io.ReadSeeker File string }
type LocalVideoElement ¶ added in v0.9.38
type LocalVideoElement struct { message.ShortVideoElement File string // contains filtered or unexported fields }
type LocalVoiceElement ¶ added in v0.9.37
type LocalVoiceElement struct { message.VoiceElement Stream io.ReadSeeker }
type MSG ¶
type MSG map[string]interface{}
func ToArrayMessage ¶ added in v0.9.18
func ToArrayMessage(e []message.IMessageElement, code int64, raw ...bool) (r []MSG)
type MiguMusicElement ¶ added in v0.9.30
type MiguMusicElement struct {
MusicElement
}
type MusicElement ¶ added in v0.9.28
type MusicElement struct { Title string Summary string Url string PictureUrl string MusicUrl string }
func (*MusicElement) Type ¶ added in v0.9.28
func (e *MusicElement) Type() message.ElementType
type PokeElement ¶ added in v0.9.25
type PokeElement struct {
Target int64
}
func (*PokeElement) Type ¶ added in v0.9.25
func (e *PokeElement) Type() message.ElementType
type QQMusicElement ¶ added in v0.9.28
type QQMusicElement struct {
MusicElement
}