github.com/fumiama/NanoBot@v0.0.0-20231122134259-c22d8183efca/openapi_codegen_postopenapiof.go (about)

     1  // Code generated by codegen/postopenapiof. DO NOT EDIT.
     2  
     3  package nano
     4  
     5  import (
     6  	"io"
     7  
     8  	"github.com/pkg/errors"
     9  )
    10  
    11  func (bot *Bot) postOpenAPIofChannel(ep, contenttype string, body io.Reader) (*Channel, error) {
    12  	resp := &struct {
    13  		CodeMessageBase
    14  		Channel
    15  	}{}
    16  	err := bot.PostOpenAPI(ep, contenttype, resp, body)
    17  	if err != nil {
    18  		err = errors.Wrap(err, getCallerFuncName())
    19  	}
    20  	return &resp.Channel, err
    21  }
    22  
    23  func (bot *Bot) postOpenAPIofGuildRoleCreate(ep, contenttype string, body io.Reader) (*GuildRoleCreate, error) {
    24  	resp := &struct {
    25  		CodeMessageBase
    26  		GuildRoleCreate
    27  	}{}
    28  	err := bot.PostOpenAPI(ep, contenttype, resp, body)
    29  	if err != nil {
    30  		err = errors.Wrap(err, getCallerFuncName())
    31  	}
    32  	return &resp.GuildRoleCreate, err
    33  }
    34  
    35  func (bot *Bot) postOpenAPIofMessage(ep, contenttype string, body io.Reader) (*Message, error) {
    36  	resp := &struct {
    37  		CodeMessageBase
    38  		Message
    39  	}{}
    40  	err := bot.PostOpenAPI(ep, contenttype, resp, body)
    41  	if err != nil {
    42  		err = errors.Wrap(err, getCallerFuncName())
    43  	}
    44  	return &resp.Message, err
    45  }
    46  
    47  func (bot *Bot) postOpenAPIofDMS(ep, contenttype string, body io.Reader) (*DMS, error) {
    48  	resp := &struct {
    49  		CodeMessageBase
    50  		DMS
    51  	}{}
    52  	err := bot.PostOpenAPI(ep, contenttype, resp, body)
    53  	if err != nil {
    54  		err = errors.Wrap(err, getCallerFuncName())
    55  	}
    56  	return &resp.DMS, err
    57  }