Skip to content

Commit c286236

Browse files
add cron
1 parent 85ac29e commit c286236

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

robot/cron.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func ExecPersonalQQ(c *db.Cron) {
139139
}
140140
t := &PersonalQQRobot{
141141
Msg: &QQMessage{
142-
GroupId: int64(utils.ParseInt(groupId)),
142+
GroupId: groupId,
143143
MessageType: "group",
144144
UserID: c.CreateBy,
145145
Message: []MessageItem{

robot/personalqq.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@ import (
1111

1212
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
1313
"github.com/json-iterator/go"
14+
"github.com/json-iterator/go/extra"
1415
"github.com/yincongcyincong/MuseBot/conf"
1516
"github.com/yincongcyincong/MuseBot/i18n"
1617
"github.com/yincongcyincong/MuseBot/logger"
1718
"github.com/yincongcyincong/MuseBot/param"
1819
"github.com/yincongcyincong/MuseBot/utils"
1920
)
2021

22+
func init() {
23+
extra.RegisterFuzzyDecoders()
24+
}
25+
2126
type QQMessage struct {
2227
Font int `json:"font"`
23-
GroupId int64 `json:"group_id"`
28+
GroupId string `json:"group_id"`
2429
Message []MessageItem `json:"message"`
2530
MessageFormat string `json:"message_format"`
2631
MessageID int64 `json:"message_id"`

robot/robot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ func (r *RobotInfo) InsertCron(cron, prompt string) error {
18341834
if q.Msg.MessageType != "group" {
18351835
targetId = userId
18361836
} else {
1837-
groupId = strconv.Itoa(int(q.Msg.GroupId))
1837+
groupId = q.Msg.GroupId
18381838
}
18391839
t = param.PersonalQQ
18401840
case *TelegramRobot:

0 commit comments

Comments
 (0)