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

finish half of message

This commit is contained in:
源文雨
2023-10-11 17:50:57 +09:00
parent f2f6f52b8a
commit 64f912e856
20 changed files with 395 additions and 115 deletions

View File

@@ -18,17 +18,16 @@ import (
`
const template = `
func (bot *Bot) postOpenAPIof[T any](ep string, body io.Reader) (*[T any], error) {
func (bot *Bot) postOpenAPIof[T any](ep, contenttype string, body io.Reader) (*[T any], error) {
resp := &struct {
CodeMessageBase
[T any]
}{}
err := bot.PostOpenAPI(ep, resp, body)
err := bot.PostOpenAPI(ep, contenttype, resp, body)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
return nil, err
}
return (*[T any])(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), nil
return (*[T any])(unsafe.Add(unsafe.Pointer(resp), unsafe.Sizeof(CodeMessageBase{}))), err
}
`