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

统一Message结构体

This commit is contained in:
源文雨
2023-11-16 22:57:47 +09:00
parent d2f8a94e75
commit 947bcc5121
12 changed files with 88 additions and 225 deletions

View File

@@ -59,17 +59,17 @@ func (fp *FilePost) String() string {
// PostFileToQQUser 发送文件到 QQ 用户的 openid
//
// https://bot.q.qq.com/wiki/develop/api-231017/server-inter/message/send-receive/rich-text-media.html#%E5%8F%91%E9%80%81%E5%88%B0%E5%8D%95%E8%81%8A
func (bot *Bot) PostFileToQQUser(id string, content *FilePost) (*IDTimestampMessageResult, error) {
func (bot *Bot) PostFileToQQUser(id string, content *FilePost) (*Message, error) {
logrus.Infoln(getLogHeader(), "<= [Q]单:", id+",", content)
content.MotherFuckingAlwaysTrue = true
return bot.postOpenAPIofIDTimestampMessageResult("/v2/users/"+id+"/files", "", WriteBodyFromJSON(content))
return bot.postOpenAPIofMessage("/v2/users/"+id+"/files", "", WriteBodyFromJSON(content))
}
// PostFileToQQGroup 发送文件到 QQ 群的 openid
//
// https://bot.q.qq.com/wiki/develop/api-231017/server-inter/message/send-receive/rich-text-media.html#%E5%8F%91%E9%80%81%E5%88%B0%E7%BE%A4%E8%81%8A
func (bot *Bot) PostFileToQQGroup(id string, content *FilePost) (*IDTimestampMessageResult, error) {
func (bot *Bot) PostFileToQQGroup(id string, content *FilePost) (*Message, error) {
logrus.Infoln(getLogHeader(), "<= [Q]群:", id+",", content)
content.MotherFuckingAlwaysTrue = true
return bot.postOpenAPIofIDTimestampMessageResult("/v2/groups/"+id+"/files", "", WriteBodyFromJSON(content))
return bot.postOpenAPIofMessage("/v2/groups/"+id+"/files", "", WriteBodyFromJSON(content))
}