Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
check admin on receiving doc
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Dec 31, 2019
1 parent e6cbb30 commit 2900b75
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bot/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,17 @@ func textCtr(m *tb.Message) {

func docCtr(m *tb.Message) {

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

url, _ := B.FileURLByID(m.Document.FileID)
opml, err := GetOPMLByURL(url)

Expand Down

0 comments on commit 2900b75

Please sign in to comment.