Skip to content

Commit

Permalink
support for multi-line reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
xditya authored Jan 15, 2021
1 parent 56c4d84 commit b6daef5
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions telebot/plugins/superfban.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,25 @@ async def _(event):
fedList.append(line[:36])
except BaseException:
pass
arg = event.pattern_match.group(1)
args = arg.split()
if len(args) > 1:
FBAN = args[0]
REASON = ""
for a in args[1:]:
REASON += a + " "
arg = event.text.split(" ", maxsplit=2)
if len(arg) > 2:
FBAN = arg[1]
REASON = arg[2]
else:
FBAN = arg
FBAN = arg[1]
REASON = " #TBMassBanned "
else:
FBAN = previous_message.sender_id
REASON = event.pattern_match.group(1)
REASON = event.text.split(" ", maxsplit=1)[1]
if REASON.strip() == "":
REASON = " #TBMassBanned "
else:
arg = event.pattern_match.group(1)
args = arg.split()
if len(args) > 1:
FBAN = args[0]
REASON = ""
for a in args[1:]:
REASON += a + " "
arg = event.text.split(" ", maxsplit=2)
if len(arg) > 2:
FBAN = arg[1]
REASON = arg[2]
else:
FBAN = arg
FBAN = arg[1]
REASON = " #TBMassBanned "
try:
int(FBAN)
Expand Down Expand Up @@ -242,7 +236,7 @@ async def _(event):
"superban": ".superfban <username/userid> <reason>\
\n**Usage**: Mass-Ban in all feds you are admin in.\
\nSet `EXCLUDE_FED fedid1|fedid2` in heroku vars to exclude those feds.\
\nSet var `FBAN_GROUP_ID` ti the group with rose, where you want FBan to take place.\
\nSet var `FBAN_GROUP_ID` to the group with rose, where you want FBan to take place.\
\n\nGet help - @TeleBotSupport."
}
)

0 comments on commit b6daef5

Please sign in to comment.