1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-06 03:00:24 +08:00
Files
NanoBot/openapi_codegen_postopenapiof.go
2023-10-11 17:50:57 +09:00

47 lines
1.2 KiB
Go

// Code generated by codegen/postopenapiof. DO NOT EDIT.
package nano
import (
"io"
"unsafe"
"github.com/pkg/errors"
)
func (bot *Bot) postOpenAPIofChannel(ep, contenttype string, body io.Reader) (*Channel, error) {
resp := &struct {
CodeMessageBase
Channel
}{}
err := bot.PostOpenAPI(ep, contenttype, resp, body)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
}
return (*Channel)(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), err
}
func (bot *Bot) postOpenAPIofGuildRoleCreate(ep, contenttype string, body io.Reader) (*GuildRoleCreate, error) {
resp := &struct {
CodeMessageBase
GuildRoleCreate
}{}
err := bot.PostOpenAPI(ep, contenttype, resp, body)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
}
return (*GuildRoleCreate)(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), err
}
func (bot *Bot) postOpenAPIofMessage(ep, contenttype string, body io.Reader) (*Message, error) {
resp := &struct {
CodeMessageBase
Message
}{}
err := bot.PostOpenAPI(ep, contenttype, resp, body)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
}
return (*Message)(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), err
}