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

finish half of role

This commit is contained in:
源文雨
2023-10-10 23:54:20 +09:00
parent 5ec622d77f
commit 50939b98aa
6 changed files with 118 additions and 5 deletions

View File

@@ -21,3 +21,16 @@ func (bot *Bot) patchOpenAPIofChannel(ep string, body io.Reader) (*Channel, erro
}
return (*Channel)(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), nil
}
func (bot *Bot) patchOpenAPIofGuildRolePatch(ep string, body io.Reader) (*GuildRolePatch, error) {
resp := &struct {
CodeMessageBase
GuildRolePatch
}{}
err := bot.PatchOpenAPI(ep, resp, body)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
return nil, err
}
return (*GuildRolePatch)(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), nil
}