1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-06 03:00:24 +08:00

finish base

This commit is contained in:
源文雨
2023-10-10 14:10:13 +09:00
parent 6c87546b44
commit 3dbb8d7b34
13 changed files with 427 additions and 0 deletions

28
openapi_guild.go Normal file
View File

@@ -0,0 +1,28 @@
package nano
import "time"
// Guild 频道对象
//
// https://bot.q.qq.com/wiki/develop/api/openapi/guild/model.html
type Guild struct {
ID string `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
OwnerID string `json:"owner_id"`
Owner bool `json:"owner"`
JoinedAt time.Time `json:"joined_at"`
MemberCount int `json:"member_count"`
MaxMembers int `json:"max_members"`
Description string `json:"description"`
}
// GuildArray []Guild 的别名
type GuildArray []Guild
// GetGuildByID 获取 id 指定的频道的详情
//
// https://bot.q.qq.com/wiki/develop/api/openapi/guild/get_guild.html
func (bot *Bot) GetGuildByID(id string) (*Guild, error) {
return bot.getOpenAPIofGuild("/guilds/" + id)
}