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

finish channel permissions

This commit is contained in:
源文雨
2023-10-11 15:43:24 +09:00
parent 4745fa990e
commit f2f6f52b8a
6 changed files with 88 additions and 28 deletions

View File

@@ -98,3 +98,16 @@ func (bot *Bot) getOpenAPIofGuildRoleList(ep string) (*GuildRoleList, error) {
}
return (*GuildRoleList)(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), nil
}
func (bot *Bot) getOpenAPIofChannelPermissions(ep string) (*ChannelPermissions, error) {
resp := &struct {
CodeMessageBase
ChannelPermissions
}{}
err := bot.GetOpenAPI(ep, resp)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
return nil, err
}
return (*ChannelPermissions)(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), nil
}