Skip to content

Commit bd74bbd

Browse files
committed
fix nil pointer err
1 parent e671748 commit bd74bbd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

bot/handlers_common.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ Inline 查询支持同样的参数格式.
8484
func getPictureFile(ctx context.Context, bot *telego.Bot, message telego.Message) {
8585
messageOrigin, ok := telegram.GetMessageOriginChannelArtworkPost(ctx, bot, message)
8686
if !ok {
87-
go telegram.ReplyMessage(bot, message, "少女祈祷中...")
87+
if message.ReplyToMessage == nil {
88+
telegram.ReplyMessage(bot, message, "请回复一条频道的图片消息")
89+
return
90+
}
8891
fileBytes, err := telegram.GetMessagePhotoFileBytes(bot, message.ReplyToMessage)
8992
if err != nil {
9093
telegram.ReplyMessage(bot, message, "请回复一条频道的图片消息")

cmd/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
const (
10-
Version string = "0.10.6"
10+
Version string = "0.10.7"
1111
)
1212

1313
var VersionCmd = &cobra.Command{

0 commit comments

Comments
 (0)