Skip to content

Commit

Permalink
filter files .opml
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Dec 31, 2019
1 parent 2900b75 commit d2b2771
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions bot/controller.go
Expand Up @@ -805,21 +805,24 @@ func textCtr(m *tb.Message) {
}

func docCtr(m *tb.Message) {

if m.FromChannel() {
if !UserIsAdminChannel(m.ID, m.Chat) {
if m.FromGroup() {
if !userIsAdminOfGroup(m.ID, m.Chat) {
return
}
}
if m.FromGroup() {
if !userIsAdminOfGroup(m.ID, m.Chat) {

if m.FromChannel() {
if !UserIsAdminChannel(m.ID, m.Chat) {
return
}
}

url, _ := B.FileURLByID(m.Document.FileID)
opml, err := GetOPMLByURL(url)
if !strings.HasSuffix(url, ".opml") {
return
}

opml, err := GetOPMLByURL(url)
if err != nil {
if err.Error() == "fetch opml file error" {
_, _ = B.Send(m.Chat,
Expand Down

0 comments on commit d2b2771

Please sign in to comment.