diff --git a/bot.go b/bot.go index 6a2e931..e1e431a 100644 --- a/bot.go +++ b/bot.go @@ -2,6 +2,7 @@ package main import ( "log" + "time" "watn3y/bloaterbotv3/botIO" "watn3y/bloaterbotv3/commands" "watn3y/bloaterbotv3/text" @@ -9,12 +10,11 @@ import ( func bot() { updates, bot := botIO.Authenticate() - + now := time.Now().UTC() for update := range updates { - if update.Message == nil { + if update.Message == nil || update.Message.Time().UTC().Unix() < now.UTC().Unix() { continue } - log.Printf("[bot] Recieved Message: [%s] %s", update.Message.From.UserName, update.Message.Text) if update.Message.IsCommand() { diff --git a/commonlogic/commonlogic.go b/commonlogic/commonlogic.go index c9b188a..58d7b2c 100644 --- a/commonlogic/commonlogic.go +++ b/commonlogic/commonlogic.go @@ -1,11 +1,5 @@ package commonlogic -import ( - "reflect" - "runtime" - "strings" -) - func ContainsInt64(a []int64, b int64) bool { for _, v := range a { if v == b { @@ -15,9 +9,3 @@ func ContainsInt64(a []int64, b int64) bool { return false } - -func GetPackageName(temp interface{}) string { - strs := strings.Split((runtime.FuncForPC(reflect.ValueOf(temp).Pointer()).Name()), ".") - strs = strings.Split(strs[len(strs)-2], "/") - return strs[len(strs)-1] -}