Skip to content

Commit

Permalink
fix unexpected triggering cmds, escape . in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
aahnik committed Jun 14, 2021
1 parent 9fed465 commit abdb9bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tgcf/bot/live_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async def help_command_handler(event):

def get_events():
_ = get_command_prefix()

logging.info(f"Command prefix is {_} ")
command_events = {
"start": (start_command_handler, events.NewMessage(pattern=f"{_}start")),
"forward": (forward_command_handler, events.NewMessage(pattern=f"{_}forward")),
Expand Down
2 changes: 1 addition & 1 deletion tgcf/bot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ def remove_source(source, forwards: List[Forward]) -> List[Forward]:
def get_command_prefix():
if config.is_bot is None:
raise ValueError("config.is_bot is not set!")
return "/" if config.is_bot else "."
return "/" if config.is_bot else "\."

0 comments on commit abdb9bc

Please sign in to comment.