This commit is contained in:
shoopea 2019-05-26 20:02:44 +08:00
parent 9ec3ec7d7d
commit 7d5d5ec4d5

1
bot.go
View File

@ -272,7 +272,6 @@ func botListParsingRule(m *tb.Message) {
func botTimer(m *tb.Message) {
r := regexp.MustCompile("^(?P<Duration>([0-9]*(s|m|h))+) \"(?P<Msg>(.*))\"$")
if r.MatchString(m.Payload) {
h, _ := strconv.ParseInt(r.ReplaceAllString(m.Payload, "${Hour}"), 10, 32)
log.Printf("Timer : Duration : %s\n", r.ReplaceAllString(m.Payload, "${Duration}"))
log.Printf("Timer : Msg : %s\n", r.ReplaceAllString(m.Payload, "${Msg}"))
}