update
This commit is contained in:
@@ -102,6 +102,15 @@ func (sender *Faker) IsMedia() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (sender *Faker) Reply(msgs ...interface{}) (int, error) {
|
func (sender *Faker) Reply(msgs ...interface{}) (int, error) {
|
||||||
|
if len(msgs) == 0 {
|
||||||
|
return 0, nil
|
||||||
|
}
|
||||||
|
switch msgs[0].(type) {
|
||||||
|
case []byte:
|
||||||
|
NotifyMasters(string(msgs[0].([]byte)))
|
||||||
|
case string:
|
||||||
|
NotifyMasters(msgs[0].(string))
|
||||||
|
}
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ func init() {
|
|||||||
Rules: []string{`cron hide duplicate`},
|
Rules: []string{`cron hide duplicate`},
|
||||||
Admin: true,
|
Admin: true,
|
||||||
Cron: "*/5 * * * *",
|
Cron: "*/5 * * * *",
|
||||||
Handle: func(_ core.Sender) interface{} {
|
Handle: func(s core.Sender) interface{} {
|
||||||
w := func(s string) int {
|
w := func(s string) int {
|
||||||
if strings.Contains(s, "shufflewzc") {
|
if strings.Contains(s, "shufflewzc") {
|
||||||
return 1
|
return 1
|
||||||
@@ -232,9 +232,9 @@ func init() {
|
|||||||
tasks[crons[i].Name] = crons[i]
|
tasks[crons[i].Name] = crons[i]
|
||||||
}
|
}
|
||||||
if err := Req(CRONS, PUT, "/disable", []byte(fmt.Sprintf(`["%s"]`, dup.ID))); err != nil {
|
if err := Req(CRONS, PUT, "/disable", []byte(fmt.Sprintf(`["%s"]`, dup.ID))); err != nil {
|
||||||
// s.Reply(fmt.Sprintf("隐藏 %v %v %v", dup.Name, dup.Command, err))
|
s.Reply(fmt.Sprintf("隐藏 %v %v %v", dup.Name, dup.Command, err))
|
||||||
} else {
|
} else {
|
||||||
// s.Reply(fmt.Sprintf("已隐藏重复任务 %v %v", dup.Name, dup.Command))
|
s.Reply(fmt.Sprintf("已隐藏重复任务 %v %v", dup.Name, dup.Command))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tasks[crons[i].Name] = crons[i]
|
tasks[crons[i].Name] = crons[i]
|
||||||
|
|||||||
Reference in New Issue
Block a user