mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 10:10:25 +00:00
chore: update deps
This commit is contained in:
@@ -22,7 +22,7 @@ func (t *Timer) InsertInto(db *sql.Sqlite) error {
|
||||
|
||||
/*
|
||||
func getTimerFrom(db *sql.Sqlite, id uint32) (t Timer, err error) {
|
||||
err = db.Find("timer", &t, "where id = "+strconv.Itoa(int(id)))
|
||||
err = db.Find("timer", &t, "WHERE id = "+strconv.Itoa(int(id)))
|
||||
return
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package timer
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -29,7 +28,7 @@ type Clock struct {
|
||||
|
||||
var (
|
||||
// @全体成员
|
||||
atall = message.MessageSegment{
|
||||
atall = message.Segment{
|
||||
Type: "at",
|
||||
Data: map[string]string{
|
||||
"qq": "all",
|
||||
@@ -133,7 +132,7 @@ func (c *Clock) CancelTimer(key uint32) bool {
|
||||
}
|
||||
c.timersmu.Lock()
|
||||
delete(*c.timers, key) // 避免重复取消
|
||||
e := c.db.Del("timer", "where id = "+strconv.Itoa(int(key)))
|
||||
e := c.db.Del("timer", "WHERE id = ?", key)
|
||||
c.timersmu.Unlock()
|
||||
return e == nil
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ func TestNextWakeTime(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestClock(t *testing.T) {
|
||||
db := &sql.Sqlite{DBPath: "test.db"}
|
||||
c := NewClock(db)
|
||||
db := sql.New("test.db")
|
||||
c := NewClock(&db)
|
||||
c.AddTimerIntoDB(GetFilledTimer([]string{"", "12", "-1", "12", "0", "", "test"}, 0, 0, false))
|
||||
t.Log(c.ListTimers(0))
|
||||
t.Fail()
|
||||
|
||||
Reference in New Issue
Block a user