x
This commit is contained in:
parent
16919e23c4
commit
57c3b87224
@ -3,6 +3,7 @@ package models
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/core/logs"
|
||||
@ -53,6 +54,9 @@ func initTgBot() {
|
||||
if m.Sender.ID != Config.TelegramUserID {
|
||||
return
|
||||
}
|
||||
if regexp.MustCompile(`.js$`).FindString(m.Document.FileName) == "" && regexp.MustCompile(`.py$`).FindString(m.Document.FileName) == "" {
|
||||
return
|
||||
}
|
||||
b.Download(m.Document.MediaFile(), ExecPath+"/scripts/"+m.Document.FileName)
|
||||
m.Text = fmt.Sprintf("run " + m.Document.FileName)
|
||||
handle(m)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user