Documentation ¶
Index ¶
- Variables
- func ConvertMapToJSONString(m map[string]interface{}) (string, error)
- func ConvertQQBotToMarkdown(input string) string
- func ConvertToDiscordMessage(jsonData []byte) (*discordgo.MessageSend, error)
- func ConvertToInt64(value interface{}) (int64, error)
- func ConvertToSegmentedMessage(data interface{}) []map[string]interface{}
- func CreateSendGroupMsgAction(originalMsg callapi.ActionMessage) *callapi.ActionMessage
- func GenerateReplyMessage(foundItems map[string][]string, messageText string) (*discordgo.MessageSend, error)
- func GetGroupList(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func GetGroupMemberInfo(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func GetGroupMemberList(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func GetGuildChannelList(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func GetGuildList(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func GetGuildServiceProfile(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func GetLoginInfo(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func GetMessageIDByUseridAndGroupid(appID string, userID interface{}, groupID interface{}) string
- func GetMessageIDByUseridOrGroupid(appID string, userID interface{}) string
- func GetMessageTypeByGroupid(appID string, GroupID interface{}) string
- func GetMessageTypeByGroupidV2(GroupID interface{}) string
- func GetMessageTypeByUserid(appID string, userID interface{}) string
- func GetMessageTypeByUseridV2(userID interface{}) string
- func GetOnlineClients(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func GetStatus(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func GetVersionInfo(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func HandleGetFriendList(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func HandleGetGroupInfo(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func HandleSendGroupForwardMsg(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func HandleSendGroupMsg(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func HandleSendGuildChannelMsg(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func HandleSendGuildChannelPrivateMsg(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage, ...) (string, error)
- func HandleSendMsg(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func HandleSendPrivateMsg(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func Handle_quick_operation(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func MarkThisMessageAsRead(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- func RevertTransformedText(data interface{}, msgtype string, s *discordgo.Session, vgid int64) string
- func SendMessage(messageText string, data interface{}, messageType string, s *discordgo.Session) error
- func SendResponse(client callapi.Client, err error, message *callapi.ActionMessage) (string, error)
- func SetGroupBan(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
- type APIOutput
- type ActionData
- type Button
- type FriendData
- type GetStatusResponse
- type Group
- type GroupInfo
- type GroupList
- type Guild
- type GuildChannelListResponse
- type GuildData
- type GuildListResponse
- type GuildServiceProfileData
- type GuildServiceProfileResponse
- type Keyboard
- type KeyboardContent
- type LoginInfoData
- type LoginInfoResponse
- type MarkThisMessageAsReadAPIResponse
- type Markdown
- type MemberInfo
- type MemberList
- type MessageData
- type OnebotGroupInfo
- type OnlineClientsData
- type OnlineClientsResponse
- type Permission
- type RenderData
- type Response
- type Row
- type ServerResponse
- type Statistics
- type StatusData
- type VersionData
- type VersionInfoResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var AppID string
View Source
var BotID string
Functions ¶
func ConvertMapToJSONString ¶
将map转化为json string
func ConvertQQBotToMarkdown ¶
转换 qqbot 标签为 Discord 支持的 Markdown 格式
func ConvertToDiscordMessage ¶
func ConvertToDiscordMessage(jsonData []byte) (*discordgo.MessageSend, error)
将输入的字节类型 JSON 转换为 Discord 可发送的消息结构
func ConvertToInt64 ¶
ConvertToInt64 尝试将 interface{} 类型的值转换为 int64 类型
func ConvertToSegmentedMessage ¶
func ConvertToSegmentedMessage(data interface{}) []map[string]interface{}
将收到的data.content转换为message segment todo,群场景不支持受图片,频道场景的图片可以拼一下
func CreateSendGroupMsgAction ¶
func CreateSendGroupMsgAction(originalMsg callapi.ActionMessage) *callapi.ActionMessage
func GenerateReplyMessage ¶
func GenerateReplyMessage(foundItems map[string][]string, messageText string) (*discordgo.MessageSend, error)
GenerateReplyMessage 创建一个discordgo兼容的消息,支持多个图片
func GetGroupList ¶
func GetGroupMemberInfo ¶
func GetGroupMemberInfo(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage) (string, error)
getGroupMemberInfo是处理获取群成员信息的函数
func GetGroupMemberList ¶
func GetGuildChannelList ¶
func GetGuildList ¶
func GetGuildServiceProfile ¶
func GetLoginInfo ¶
func GetMessageIDByUseridAndGroupid ¶
通过user_id获取messageID
func GetMessageIDByUseridOrGroupid ¶
通过user_id获取messageID
func GetMessageTypeByGroupid ¶
通过group_id获取类型
func GetMessageTypeByGroupidV2 ¶
func GetMessageTypeByGroupidV2(GroupID interface{}) string
通过group_id获取类型
func GetMessageTypeByUserid ¶
通过user_id获取类型
func GetMessageTypeByUseridV2 ¶
func GetMessageTypeByUseridV2(userID interface{}) string
通过user_id获取类型
func GetOnlineClients ¶
func GetVersionInfo ¶
func HandleGetFriendList ¶
func HandleGetGroupInfo ¶
func HandleSendGroupMsg ¶
func HandleSendGuildChannelPrivateMsg ¶
func HandleSendGuildChannelPrivateMsg(client callapi.Client, s *discordgo.Session, message callapi.ActionMessage, optionalGuildID *string, optionalChannelID *string) (string, error)
处理频道私信 最后2个指针参数可空 代表使用userid倒推
func HandleSendMsg ¶
func HandleSendPrivateMsg ¶
func Handle_quick_operation ¶
func MarkThisMessageAsRead ¶
func RevertTransformedText ¶
func RevertTransformedText(data interface{}, msgtype string, s *discordgo.Session, vgid int64) string
处理at和其他定形文到onebotv11格式(cq码)
func SendMessage ¶
func SendMessage(messageText string, data interface{}, messageType string, s *discordgo.Session) error
SendMessage 发送消息根据不同的类型
func SendResponse ¶
发送成功回执 todo 返回可互转的messageid
func SetGroupBan ¶
Types ¶
type APIOutput ¶
type APIOutput struct { Data []FriendData `json:"data"` Message string `json:"message"` RetCode int `json:"retcode"` Status string `json:"status"` Echo interface{} `json:"echo"` }
type ActionData ¶
type ActionData struct { Data string `json:"data"` Enter bool `json:"enter"` Permission Permission `json:"permission"` }
type Button ¶
type Button struct { Action ActionData `json:"action"` RenderData RenderData `json:"render_data"` }
定义 JSON 结构的解析对象
type FriendData ¶
type GetStatusResponse ¶
type GetStatusResponse struct { Data StatusData `json:"data"` Message string `json:"message"` RetCode int `json:"retcode"` Status string `json:"status"` Echo interface{} `json:"echo"` }
type Group ¶
type Group struct { GroupCreateTime int32 `json:"group_create_time"` GroupID int64 `json:"group_id"` GroupLevel int32 `json:"group_level"` GroupMemo string `json:"group_memo"` GroupName string `json:"group_name"` MaxMemberCount int32 `json:"max_member_count"` MemberCount int32 `json:"member_count"` }
type GroupInfo ¶
type GroupInfo struct { GroupID int64 `json:"group_id"` GroupName string `json:"group_name"` GroupMemo string `json:"group_memo"` GroupCreateTime int32 `json:"group_create_time"` GroupLevel int32 `json:"group_level"` MemberCount int32 `json:"member_count"` MaxMemberCount int32 `json:"max_member_count"` }
type GuildListResponse ¶
type GuildServiceProfileData ¶
type GuildServiceProfileResponse ¶
type GuildServiceProfileResponse struct { Data GuildServiceProfileData `json:"data"` Message string `json:"message"` RetCode int `json:"retcode"` Status string `json:"status"` Echo interface{} `json:"echo"` }
type Keyboard ¶
type Keyboard struct {
Content KeyboardContent `json:"content"`
}
type KeyboardContent ¶
type KeyboardContent struct {
Rows []Row `json:"rows"`
}
type LoginInfoData ¶
type LoginInfoResponse ¶
type LoginInfoResponse struct { Data LoginInfoData `json:"data"` Message string `json:"message"` RetCode int `json:"retcode"` Status string `json:"status"` Echo interface{} `json:"echo"` }
type MemberInfo ¶
type MemberInfo struct { UserID int64 `json:"user_id"` GroupID int64 `json:"group_id"` Nickname string `json:"nickname"` Card string `json:"card"` Sex string `json:"sex"` Age int32 `json:"age"` Area string `json:"area"` JoinTime int32 `json:"join_time"` LastSentTime int32 `json:"last_sent_time"` Level string `json:"level"` Role string `json:"role"` Unfriendly bool `json:"unfriendly"` Title string `json:"title"` TitleExpireTime int64 `json:"title_expire_time"` CardChangeable bool `json:"card_changeable"` ShutUpTimestamp int64 `json:"shut_up_timestamp"` }
成员信息的结构定义
type MemberList ¶
type MemberList struct { GroupID int64 `json:"group_id"` UserID int64 `json:"user_id"` Nickname string `json:"nickname"` Card string `json:"card"` Sex string `json:"sex"` Age int32 `json:"age"` Area string `json:"area"` JoinTime int32 `json:"join_time"` LastSentTime int32 `json:"last_sent_time"` Level string `json:"level"` Role string `json:"role"` Unfriendly bool `json:"unfriendly"` Title string `json:"title"` TitleExpireTime int64 `json:"title_expire_time"` CardChangeable bool `json:"card_changeable"` ShutUpTimestamp int64 `json:"shut_up_timestamp"` }
Member Onebot 群成员
type MessageData ¶
type OnebotGroupInfo ¶
type OnebotGroupInfo struct { Data GroupInfo `json:"data"` Message string `json:"message"` RetCode int `json:"retcode"` Status string `json:"status"` Echo interface{} `json:"echo"` }
func ConvertGuildToGroupInfo ¶
func ConvertGuildToGroupInfo(guild *discordgo.Guild, GroupId string, message callapi.ActionMessage) *OnebotGroupInfo
type OnlineClientsData ¶
type OnlineClientsData struct { Clients []interface{} `json:"clients"` // It seems you want an empty array for clients TinyID int64 `json:"tiny_id"` }
type OnlineClientsResponse ¶
type OnlineClientsResponse struct { Data OnlineClientsData `json:"data"` Message string `json:"message"` RetCode int `json:"retcode"` Status string `json:"status"` Echo interface{} `json:"echo"` }
type Permission ¶
type Permission struct {
Type int `json:"type"`
}
type RenderData ¶
type Response ¶
type Response struct { Retcode int `json:"retcode"` Status string `json:"status"` Data []MemberList `json:"data"` Echo interface{} `json:"echo"` // 使用 interface{} 类型以容纳整数或文本 }
type ServerResponse ¶
type ServerResponse struct { Data struct { MessageID int `json:"message_id"` } `json:"data"` Message string `json:"message"` RetCode int `json:"retcode"` Status string `json:"status"` Echo interface{} `json:"echo"` }
定义响应结构体
type Statistics ¶
type Statistics struct { PacketReceived uint64 `json:"packet_received"` PacketSent uint64 `json:"packet_sent"` PacketLost uint32 `json:"packet_lost"` MessageReceived uint64 `json:"message_received"` MessageSent uint64 `json:"message_sent"` DisconnectTimes uint32 `json:"disconnect_times"` LostTimes uint32 `json:"lost_times"` LastMessageTime int64 `json:"last_message_time"` }
type StatusData ¶
type VersionData ¶
type VersionData struct { AppFullName string `json:"app_full_name"` AppName string `json:"app_name"` AppVersion string `json:"app_version"` CoolQDirectory string `json:"coolq_directory"` CoolQEdition string `json:"coolq_edition"` GoCQHTTP bool `json:"go-cqhttp"` PluginBuildConfiguration string `json:"plugin_build_configuration"` PluginBuildNumber int `json:"plugin_build_number"` PluginVersion string `json:"plugin_version"` ProtocolName int `json:"protocol_name"` ProtocolVersion string `json:"protocol_version"` RuntimeOS string `json:"runtime_os"` RuntimeVersion string `json:"runtime_version"` Version string `json:"version"` }
type VersionInfoResponse ¶
type VersionInfoResponse struct { Data VersionData `json:"data"` Message string `json:"message"` RetCode int `json:"retcode"` Status string `json:"status"` Echo interface{} `json:"echo"` }
Source Files ¶
- get_friend_list.go
- get_group_info.go
- get_group_list.go
- get_group_member_info.go
- get_group_member_list.go
- get_guild_channel_list.go
- get_guild_list.go
- get_guild_service_profile.go
- get_login_info.go
- get_online_clients.go
- get_status.go
- get_version_info.go
- handle_quick_operation.go
- handle_quick_operation_async.go
- mark_msg_as_read.go
- message_parser.go
- send_group_forward_msg.go
- send_group_msg.go
- send_group_msg_async.go
- send_guild_channel_msg.go
- send_msg.go
- send_msg_async.go
- send_private_msg.go
- send_private_msg_async.go
- set_group_ban.go
Click to show internal directories.
Click to hide internal directories.