mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-05 10:40:24 +08:00
58 lines
1.3 KiB
Go
58 lines
1.3 KiB
Go
// Code generated by codegen/postopenapiof. DO NOT EDIT.
|
|
|
|
package nano
|
|
|
|
import (
|
|
"io"
|
|
|
|
"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 &resp.Channel, 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 &resp.GuildRoleCreate, 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 &resp.Message, err
|
|
}
|
|
|
|
func (bot *Bot) postOpenAPIofDMS(ep, contenttype string, body io.Reader) (*DMS, error) {
|
|
resp := &struct {
|
|
CodeMessageBase
|
|
DMS
|
|
}{}
|
|
err := bot.PostOpenAPI(ep, contenttype, resp, body)
|
|
if err != nil {
|
|
err = errors.Wrap(err, getCallerFuncName())
|
|
}
|
|
return &resp.DMS, err
|
|
}
|