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

fix array

This commit is contained in:
源文雨
2023-10-10 22:32:02 +09:00
parent 30554f4ffc
commit e8fd4c0c54
6 changed files with 41 additions and 41 deletions

View File

@@ -60,14 +60,12 @@ type Channel struct {
Permissions string `json:"permissions"`
}
// ChannelArray []Channel 的别名
type ChannelArray []Channel
// GetChannelsOfGuild 获取 guild_id 指定的频道下的子频道列表
//
// https://bot.q.qq.com/wiki/develop/api/openapi/channel/get_channels.html
func (bot *Bot) GetChannelsOfGuild(id string) (*ChannelArray, error) {
return bot.getOpenAPIofChannelArray("/guilds/" + id + "/channels")
func (bot *Bot) GetChannelsOfGuild(id string) (channels []Channel, err error) {
err = bot.GetOpenAPI("/guilds/"+id+"/channels", &channels)
return
}
// GetChannelByID 用于获取 channel_id 指定的子频道的详情