Documentation ¶
Index ¶
- Variables
- func NewPluginTask(task Task)
- func NewTask(task Task)
- func RunCoralBot(port string, e *Event)
- type ChannelInfo
- type Condition
- type Event
- type Handle
- func (h Handle) CanSendImage() (map[string]interface{}, error)
- func (h Handle) CanSendRecord() (map[string]interface{}, error)
- func (h Handle) CheckUrlSafely(u string) (map[string]interface{}, error)
- func (h Handle) CleanCache() (map[string]interface{}, error)
- func (h Handle) CreateGroupFileFolder(groupId int64, name string, parentId string) (map[string]interface{}, error)
- func (h Handle) CreateGuildRole(guildID string, name string, color string, independent bool, ...) (map[string]interface{}, error)
- func (h Handle) DeleteEssenceMsg(messageId int32) (map[string]interface{}, error)
- func (h Handle) DeleteFriend(friendId int64) (map[string]interface{}, error)
- func (h Handle) DeleteGroupFile(groupId int64, fileId string, busId int32) (map[string]interface{}, error)
- func (h Handle) DeleteGroupFolder(groupId int64, folderId string) (map[string]interface{}, error)
- func (h Handle) DeleteGuildRole(guildID string, roleID string) (map[string]interface{}, error)
- func (h Handle) DeleteMsg(messageId int32) (map[string]interface{}, error)
- func (h Handle) DownloadFile(fileUrl string, threadCount int32, headers string) (map[string]interface{}, error)
- func (h Handle) GetCookies(domain string) (map[string]interface{}, error)
- func (h Handle) GetCredentials(domain string) (map[string]interface{}, error)
- func (h Handle) GetCsrfToken() (map[string]interface{}, error)
- func (h Handle) GetEssenceMsgList(groupId int64) (map[string]interface{}, error)
- func (h Handle) GetForwardMsg(messageId int32) (map[string]interface{}, error)
- func (h Handle) GetFriendList() (map[string]interface{}, error)
- func (h Handle) GetGroupAtAllRemain(groupId int64) (map[string]interface{}, error)
- func (h Handle) GetGroupFileSystemInfo(groupId int64) (map[string]interface{}, error)
- func (h Handle) GetGroupFileUrl(groupId int64, fileId string, busId int32) (map[string]interface{}, error)
- func (h Handle) GetGroupFilesByFolder(groupId int64, folderId string) (map[string]interface{}, error)
- func (h Handle) GetGroupHonorInfo(groupId int64, typ string) (map[string]interface{}, error)
- func (h Handle) GetGroupInfo(groupId int64, noCache bool) (map[string]interface{}, error)
- func (h Handle) GetGroupList() (map[string]interface{}, error)
- func (h Handle) GetGroupMemberInfo(groupId int64, userId int64, noCache bool) (map[string]interface{}, error)
- func (h Handle) GetGroupMemberList(groupId int64) (map[string]interface{}, error)
- func (h Handle) GetGroupMsgHistory(messageSeq int64, groupId int64) (map[string]interface{}, error)
- func (h Handle) GetGroupNotice(groupId int64) (map[string]interface{}, error)
- func (h Handle) GetGroupRootFiles(groupId int64) (map[string]interface{}, error)
- func (h Handle) GetGroupSystemMsg() (map[string]interface{}, error)
- func (h Handle) GetGuildChannelList(guildID string, noCache bool) (map[string]interface{}, error)
- func (h Handle) GetGuildList() (map[string]interface{}, error)
- func (h Handle) GetGuildMemberList(guildID string, nextToken string) (map[string]interface{}, error)
- func (h Handle) GetGuildMemberProfile(guildID string, userID string) (map[string]interface{}, error)
- func (h Handle) GetGuildMetaByGuest(guildID string) (map[string]interface{}, error)
- func (h Handle) GetGuildMsg(messageID string, noCache bool) (map[string]interface{}, error)
- func (h Handle) GetGuildRoles(guildID string) (map[string]interface{}, error)
- func (h Handle) GetGuildServiceProfile() (map[string]interface{}, error)
- func (h Handle) GetImage(file string) (map[string]interface{}, error)
- func (h Handle) GetLoginInfo() (map[string]interface{}, error)
- func (h Handle) GetModelShow(model string) (map[string]interface{}, error)
- func (h Handle) GetMsg(messageId int32) (map[string]interface{}, error)
- func (h Handle) GetOnlineClients(noCache bool) (map[string]interface{}, error)
- func (h Handle) GetRecord(file string, outFormat string) (map[string]interface{}, error)
- func (h Handle) GetStatus() (map[string]interface{}, error)
- func (h Handle) GetStrangerInfo(userId int64, noCache bool) (map[string]interface{}, error)
- func (h Handle) GetTopicChannelFeeds(guildID string, channelID string) (map[string]interface{}, error)
- func (h Handle) GetUnidirectionalFriendList() (map[string]interface{}, error)
- func (h Handle) GetVersionInfo() (map[string]interface{}, error)
- func (h Handle) MarkMsgAsRead(messageId int32) (map[string]interface{}, error)
- func (h Handle) OcrImage(image string) (map[string]interface{}, error)
- func (h Handle) QiDianGetAccountInfo() (map[string]interface{}, error)
- func (h Handle) ReloadEventFilter(file string) (map[string]interface{}, error)
- func (h Handle) Reply(e Event, m Msg) (map[string]interface{}, error)
- func (h Handle) SendGroupMsg(m Msg) (map[string]interface{}, error)
- func (h Handle) SendGroupNotice(groupId int64, content string, image string) (map[string]interface{}, error)
- func (h Handle) SendGroupSign(groupId int64) (map[string]interface{}, error)
- func (h Handle) SendGuildChannelMsg(guildID string, channelID string, message string) (map[string]interface{}, error)
- func (h Handle) SendMsg(m Msg) (map[string]interface{}, error)
- func (h Handle) SendPrivateMsg(m Msg) (map[string]interface{}, error)
- func (h Handle) SetEssenceMsg(messageId int32) (map[string]interface{}, error)
- func (h Handle) SetFriendAddRequest(flag string, approve bool, remark string) (map[string]interface{}, error)
- func (h Handle) SetGroupAddRequest(flag string, subType string, approve bool, reason string) (map[string]interface{}, error)
- func (h Handle) SetGroupAdmin(groupId int64, userId int64, enable bool) (map[string]interface{}, error)
- func (h Handle) SetGroupAnonymous(groupId int64, enable bool) (map[string]interface{}, error)
- func (h Handle) SetGroupAnonymousBan(groupId int64, flag string, duration string) (map[string]interface{}, error)
- func (h Handle) SetGroupBan(groupId int64, userId int64, duration string) (map[string]interface{}, error)
- func (h Handle) SetGroupKick(groupId int64, userId int64, rejectAddRequest bool) (map[string]interface{}, error)
- func (h Handle) SetGroupLeave(groupId int64, isDismiss bool) (map[string]interface{}, error)
- func (h Handle) SetGroupName(groupId int64, groupName string) (map[string]interface{}, error)
- func (h Handle) SetGroupPortrait(groupId int64, file string, cache int) (map[string]interface{}, error)
- func (h Handle) SetGroupSpecialTitle(groupId int64, userId int64, specialTitle string, duration string) (map[string]interface{}, error)
- func (h Handle) SetGroupWholeBan(groupId int64, enable bool) (map[string]interface{}, error)
- func (h Handle) SetGuildMemberRole(guildID string, set bool, roleID string, users string) (map[string]interface{}, error)
- func (h Handle) SetModelShow(model string, modelShow string) (map[string]interface{}, error)
- func (h Handle) SetQQProfile(p Profile) (map[string]interface{}, error)
- func (h Handle) SetRestart(delay int) (map[string]interface{}, error)
- func (h Handle) UpdateGuildRole(guildID string, roleID string, name string, color string, indepedent bool) (map[string]interface{}, error)
- func (h Handle) UploadGroupFile(groupId int64, file string, name string, folder string) (map[string]interface{}, error)
- func (h Handle) UploadPrivateFile(userId int64, file string, name string) (map[string]interface{}, error)
- type Msg
- type Other
- type PluginInfo
- type PluginTool
- type Profile
- type Task
Constants ¶
This section is empty.
Variables ¶
var Tasks []Task
Functions ¶
func RunCoralBot ¶
Types ¶
type ChannelInfo ¶ added in v0.2.0
type ChannelInfo struct { OwnerGuildID string `json:"owner_guild_id"` ChannelID string `json:"channel_id"` ChannelType int32 `json:"channel_type"` ChannelName string `json:"channel_name"` CreateTime int64 `json:"create_time"` CreatorTinyID string `json:"creator_tiny_id"` TalkPermission int32 `json:"talk_permission"` VisibleType int32 `json:"visible_type"` CurrentSlowMode int32 `json:"current_slow_mode"` SlowModes []struct { SlowModeKey int32 `json:"slow_mode_key"` SlowModeText string `json:"slow_mode_text"` SpeakFrequency int32 `json:"speak_frequency"` SlowModeCircle int32 `json:"slow_mode_circle"` } `json:"slow_modes"` }
ChannelInfo 频道信息
type Event ¶
type Event struct { //https://docs.go-cqhttp.org/event/ //bodyData []byte PostType string `json:"post_type"` RequestType string `json:"request_type"` MessageType string `json:"message_type"` Time int64 `json:"time"` SelfID int64 `json:"self_id"` SubType string `json:"sub_type"` RawMessage string `json:"raw_message"` Font int32 `json:"font"` TempSource int64 `json:"temp_source"` Sender struct { Age int32 `json:"age"` Nickname string `json:"nickname"` Sex string `json:"sex"` UserID int64 `json:"user_id"` Area string `json:"area"` Card string `json:"card"` Level string `json:"level"` Role string `json:"role"` Title string `json:"title"` //频道 TinyID string `json:"tiny_id"` } `json:"sender"` Anonymous struct { ID int64 `json:"id"` Name string `json:"name"` Flag string `json:"flag"` } `json:"anonymous"` GroupID int64 `json:"group_id"` Message string `json:"message"` MessageSeq int `json:"message_seq"` UserID int64 `json:"user_id"` GuildUserID string `json:"guild_user_id"` MessageID int32 `json:"message_id"` GuildMessageID string `json:"guild_message_id"` NoticeType string `json:"notice_type"` MetaEventType string `json:"meta_event_type"` File struct { BusID int64 `json:"busid"` ID string `json:"id"` Name string `json:"name"` Size int64 `json:"size"` URL string `json:"url"` } `json:"file"` OperatorID int64 `json:"operator_id"` Duration int64 `json:"duration"` SenderID int64 `json:"sender_id"` TargetID int64 `json:"target_id"` HonorType string `json:"honor_type"` CardNew string `json:"card_new"` CardOld string `json:"card_old"` Comment string `json:"comment"` Flag string `json:"flag"` Client struct { AppID int64 `json:"app_id"` DeviceName string `json:"device_name"` DeviceKind string `json:"device_kind"` } `json:"client"` Online bool `json:"online"` //频道 GuildID string `json:"guild_id"` ChannelID string `json:"channel_id"` CurrentReactions []struct { EmojiID string `json:"emoji_id"` EmojiIndex int32 `json:"emoji_index"` EmojiType int32 `json:"emoji_type"` EmojiName string `json:"emoji_name"` Count int32 `json:"count"` Clicked bool `json:"clicked"` } `json:"current_reactions"` OldInfo ChannelInfo `json:"old_info"` NewInfo ChannelInfo `json:"new_info"` ChannelInfo ChannelInfo `json:"channel_info"` Other Other }
Event 消息全部信息
type Handle ¶
func (Handle) CanSendImage ¶
CanSendImage 检查是否可以发送图片
func (Handle) CanSendRecord ¶
CanSendRecord 检查是否可以发送语音
func (Handle) CheckUrlSafely ¶
CheckUrlSafely 检查链接安全性
func (Handle) CleanCache ¶
CleanCache 清理缓存
func (Handle) CreateGroupFileFolder ¶
func (h Handle) CreateGroupFileFolder(groupId int64, name string, parentId string) (map[string]interface{}, error)
CreateGroupFileFolder 创建群文件文件夹
func (Handle) CreateGuildRole ¶ added in v0.2.0
func (h Handle) CreateGuildRole(guildID string, name string, color string, independent bool, initialUsers string) (map[string]interface{}, error)
CreateGuildRole 创建频道角色
func (Handle) DeleteEssenceMsg ¶
DeleteEssenceMsg 移除精华消息
func (Handle) DeleteFriend ¶
DeleteFriend 删除好友
func (Handle) DeleteGroupFile ¶
func (h Handle) DeleteGroupFile(groupId int64, fileId string, busId int32) (map[string]interface{}, error)
DeleteGroupFile 删除群文件
func (Handle) DeleteGroupFolder ¶
DeleteGroupFolder 删除群文件夹
func (Handle) DeleteGuildRole ¶ added in v0.2.0
DeleteGuildRole 删除频道角色
func (Handle) DownloadFile ¶
func (h Handle) DownloadFile(fileUrl string, threadCount int32, headers string) (map[string]interface{}, error)
DownloadFile 下载文件到缓存目录
func (Handle) GetCookies ¶
GetCookies 获取 Cookies 该 API 暂未被 go-cqhttp 支持, 您可以提交 pr 以使该 API 被支持 提交 pr
func (Handle) GetCredentials ¶
GetCredentials 获取 QQ 相关接口凭证 该 API 暂未被 go-cqhttp 支持, 您可以提交 pr 以使该 API 被支持 提交 pr 即GetCookies和GetCsrfToken两个接口的合并
func (Handle) GetCsrfToken ¶
GetCsrfToken 获取 CSRF Token 该 API 暂未被 go-cqhttp 支持, 您可以提交 pr 以使该 API 被支持 提交 pr
func (Handle) GetEssenceMsgList ¶
GetEssenceMsgList 获取精华消息列表
func (Handle) GetForwardMsg ¶
GetForwardMsg 获取合并转发内容
func (Handle) GetFriendList ¶
GetFriendList 获取好友列表
func (Handle) GetGroupAtAllRemain ¶
GetGroupAtAllRemain 获取群@全体成员剩余次数
func (Handle) GetGroupFileSystemInfo ¶
GetGroupFileSystemInfo 获取群文件系统信息
func (Handle) GetGroupFileUrl ¶
func (h Handle) GetGroupFileUrl(groupId int64, fileId string, busId int32) (map[string]interface{}, error)
GetGroupFileUrl 获取群文件资源链接
func (Handle) GetGroupFilesByFolder ¶
func (h Handle) GetGroupFilesByFolder(groupId int64, folderId string) (map[string]interface{}, error)
GetGroupFilesByFolder 获取群子目录文件列表
func (Handle) GetGroupHonorInfo ¶
GetGroupHonorInfo 获取群荣誉信息
func (Handle) GetGroupInfo ¶
GetGroupInfo 获取群信息
func (Handle) GetGroupList ¶
GetGroupList 获取群列表
func (Handle) GetGroupMemberInfo ¶
func (h Handle) GetGroupMemberInfo(groupId int64, userId int64, noCache bool) (map[string]interface{}, error)
GetGroupMemberInfo 获取群成员信息
func (Handle) GetGroupMemberList ¶
GetGroupMemberList 获取群成员列表
func (Handle) GetGroupMsgHistory ¶
GetGroupMsgHistory 获取群消息历史记录
func (Handle) GetGroupNotice ¶
GetGroupNotice 获取群公告
func (Handle) GetGroupRootFiles ¶
GetGroupRootFiles 获取群根目录文件列表
func (Handle) GetGroupSystemMsg ¶
GetGroupSystemMsg 获取群系统消息 如果列表不存在任何消息, 将返回 null
func (Handle) GetGuildChannelList ¶ added in v0.2.0
GetGuildChannelList 获取子频道列表
func (Handle) GetGuildList ¶ added in v0.2.0
GetGuildList 获取频道列表
func (Handle) GetGuildMemberList ¶ added in v0.2.0
func (h Handle) GetGuildMemberList(guildID string, nextToken string) (map[string]interface{}, error)
GetGuildMemberList 获取频道成员列表
func (Handle) GetGuildMemberProfile ¶ added in v0.2.0
func (h Handle) GetGuildMemberProfile(guildID string, userID string) (map[string]interface{}, error)
GetGuildMemberProfile 单独获取频道成员信息
func (Handle) GetGuildMetaByGuest ¶ added in v0.2.0
GetGuildMetaByGuest 通过访客获取频道元数据
func (Handle) GetGuildMsg ¶ added in v0.2.0
GetGuildMsg 获取频道消息
func (Handle) GetGuildRoles ¶ added in v0.2.0
GetGuildRoles 获取频道角色列表
func (Handle) GetGuildServiceProfile ¶ added in v0.2.0
GetGuildServiceProfile 获取频道系统内BOT的资料
func (Handle) GetLoginInfo ¶
GetLoginInfo 获取登录号信息
func (Handle) GetModelShow ¶
GetModelShow 获取在线机型
func (Handle) GetOnlineClients ¶
GetOnlineClients 获取当前账号在线客户端列表
func (Handle) GetRecord ¶
GetRecord 获取语音 该 API 暂未被 go-cqhttp 支持, 您可以提交 pr 以使该 API 被支持 提交 pr 要使用此接口, 通常需要安装 ffmpeg, 请参考 OneBot 实现的相关说明。
func (Handle) GetStrangerInfo ¶
GetStrangerInfo 获取陌生人信息
func (Handle) GetTopicChannelFeeds ¶ added in v0.2.0
func (h Handle) GetTopicChannelFeeds(guildID string, channelID string) (map[string]interface{}, error)
GetTopicChannelFeeds 获取话题频道帖子
func (Handle) GetUnidirectionalFriendList ¶
GetUnidirectionalFriendList 获取单向好友列表
func (Handle) GetVersionInfo ¶
GetVersionInfo 获取版本信息
func (Handle) MarkMsgAsRead ¶
MarkMsgAsRead 标记消息已读
func (Handle) QiDianGetAccountInfo ¶
QiDianGetAccountInfo 获取企点账号信息 该API只有企点协议可用
func (Handle) ReloadEventFilter ¶
ReloadEventFilter 重载事件过滤器
func (Handle) SendGroupMsg ¶
SendGroupMsg 发送群聊消息 func (h Handle) SendGroupMsg(groupId int64, message string, autoEscape string) (map[string]interface{}, error) {
func (Handle) SendGroupNotice ¶
func (h Handle) SendGroupNotice(groupId int64, content string, image string) (map[string]interface{}, error)
SendGroupNotice 发送群公告
func (Handle) SendGroupSign ¶
SendGroupSign 群打卡
func (Handle) SendGuildChannelMsg ¶ added in v0.2.0
func (h Handle) SendGuildChannelMsg(guildID string, channelID string, message string) (map[string]interface{}, error)
SendGuildChannelMsg 发送信息到子频道
func (Handle) SendMsg ¶
SendMsg 发送消息 func (h Handle) SendMsg(userId int64, groupId int64, message string, autoEscape string) (map[string]interface{}, error) {
func (Handle) SendPrivateMsg ¶
SendPrivateMsg 发送私聊消息
func (Handle) SetEssenceMsg ¶
SetEssenceMsg 设置精华消息
func (Handle) SetFriendAddRequest ¶
func (h Handle) SetFriendAddRequest(flag string, approve bool, remark string) (map[string]interface{}, error)
SetFriendAddRequest 处理加好友请求
func (Handle) SetGroupAddRequest ¶
func (h Handle) SetGroupAddRequest(flag string, subType string, approve bool, reason string) (map[string]interface{}, error)
SetGroupAddRequest 处理加群请求/邀请
func (Handle) SetGroupAdmin ¶
func (h Handle) SetGroupAdmin(groupId int64, userId int64, enable bool) (map[string]interface{}, error)
SetGroupAdmin 群组设置管理员
func (Handle) SetGroupAnonymous ¶
SetGroupAnonymous 群组匿名
func (Handle) SetGroupAnonymousBan ¶
func (h Handle) SetGroupAnonymousBan(groupId int64, flag string, duration string) (map[string]interface{}, error)
SetGroupAnonymousBan 群组匿名用户禁言
func (Handle) SetGroupBan ¶
func (h Handle) SetGroupBan(groupId int64, userId int64, duration string) (map[string]interface{}, error)
SetGroupBan 群组单人禁言
func (Handle) SetGroupKick ¶
func (h Handle) SetGroupKick(groupId int64, userId int64, rejectAddRequest bool) (map[string]interface{}, error)
SetGroupKick 群组踢人
func (Handle) SetGroupLeave ¶
SetGroupLeave 退出群聊
func (Handle) SetGroupName ¶
SetGroupName 修改群聊名称
func (Handle) SetGroupPortrait ¶
func (h Handle) SetGroupPortrait(groupId int64, file string, cache int) (map[string]interface{}, error)
SetGroupPortrait 设置群头像 目前这个API在登录一段时间后因cookie失效而失效, 请考虑后使用
func (Handle) SetGroupSpecialTitle ¶
func (h Handle) SetGroupSpecialTitle(groupId int64, userId int64, specialTitle string, duration string) (map[string]interface{}, error)
SetGroupSpecialTitle 设置群组专属头衔
func (Handle) SetGroupWholeBan ¶
SetGroupWholeBan 群组全员禁言
func (Handle) SetGuildMemberRole ¶ added in v0.2.0
func (h Handle) SetGuildMemberRole(guildID string, set bool, roleID string, users string) (map[string]interface{}, error)
SetGuildMemberRole 设置用户在频道中的角色
func (Handle) SetModelShow ¶
SetModelShow 设置在线机型
func (Handle) SetQQProfile ¶
SetQQProfile 设置登录号资料
func (Handle) SetRestart ¶
SetRestart 重启 go-cqhttp
func (Handle) UpdateGuildRole ¶ added in v0.2.0
func (h Handle) UpdateGuildRole(guildID string, roleID string, name string, color string, indepedent bool) (map[string]interface{}, error)
UpdateGuildRole 设置用户在频道中的角色
type PluginInfo ¶ added in v0.3.0
type PluginInfo struct { // 插件名称 Name string // 插件简介 Summary string // 插件版本 Version string // 插件开发者 Developer string // 插件开发者邮箱 Email string }
PluginInfo 插件信息