Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta106 #266

Merged
merged 5 commits into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions handlers/send_guild_channel_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"io/ioutil"
"net/http"
"os"
"strings"
"time"

"github.com/hoshinonyaruko/gensokyo/callapi"
Expand All @@ -29,7 +30,7 @@
var msgType string
var retmsg string
var err error
var ret *dto.Message

Check failure on line 33 in handlers/send_guild_channel_msg.go

View workflow job for this annotation

GitHub Actions / Build on linux for amd64

ret declared and not used

Check failure on line 33 in handlers/send_guild_channel_msg.go

View workflow job for this annotation

GitHub Actions / Build on linux for 386

ret declared and not used

Check failure on line 33 in handlers/send_guild_channel_msg.go

View workflow job for this annotation

GitHub Actions / Build on linux for arm

ret declared and not used

Check failure on line 33 in handlers/send_guild_channel_msg.go

View workflow job for this annotation

GitHub Actions / Build on linux for arm64

ret declared and not used

Check failure on line 33 in handlers/send_guild_channel_msg.go

View workflow job for this annotation

GitHub Actions / Build on darwin for amd64

ret declared and not used

Check failure on line 33 in handlers/send_guild_channel_msg.go

View workflow job for this annotation

GitHub Actions / Build on darwin for arm64

ret declared and not used

Check failure on line 33 in handlers/send_guild_channel_msg.go

View workflow job for this annotation

GitHub Actions / Build on windows for amd64

ret declared and not used

Check failure on line 33 in handlers/send_guild_channel_msg.go

View workflow job for this annotation

GitHub Actions / Build on windows for 386

ret declared and not used
if echoStr, ok := message.Echo.(string); ok {
// 当 message.Echo 是字符串类型时执行此块
msgType = echo.GetMsgTypeByKey(echoStr)
Expand Down Expand Up @@ -131,7 +132,7 @@
mylog.Printf("发送图文混合信息失败: %v", err)
}
// 检查是否是 40003 错误
if ret.Ret == 40003 && len(newMessage.Image) > 0 {
if strings.Contains(err.Error(), `"code":40003`) && len(newMessage.Image) > 0 {
// 从 newMessage.Image 中提取图片地址
imageURL := newMessage.Image

Expand Down Expand Up @@ -225,7 +226,7 @@
mylog.Printf("发送 %s 信息失败: %v", key, err)
}
// 检查是否是 40003 错误
if ret.Ret == 40003 && len(reply.Image) > 0 {
if strings.Contains(err.Error(), `"code":40003`) && len(reply.Image) > 0 {
// 从 reply.Image 中提取图片地址
imageURL := reply.Image

Expand Down
Loading