Skip to content

Commit

Permalink
add a user limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoMengXinX committed Nov 19, 2022
1 parent 36bcda8 commit 6dcd652
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {
if update.Message != nil {
message := update.Message
atStr := strings.TrimPrefix(update.Message.CommandWithAt(), update.Message.Command())
if !message.IsCommand() || (atStr != "" && atStr != "@"+bot.Self.UserName) || !in(strconv.Itoa(int(message.From.ID)), users) {
if !message.IsCommand() || (atStr != "" && atStr != "@"+bot.Self.UserName) || (!in(strconv.Itoa(int(message.From.ID)), users) && len(botUsers) > 0) {
continue
}
switch message.Command() {
Expand Down

0 comments on commit 6dcd652

Please sign in to comment.