From 2125415f8f065207081ac7e0261218520cea790a Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 4 Jun 2018 10:13:11 +0200 Subject: [PATCH] Allow empty and multi-character prefixes in Filters.command --- pyrogram/client/filters/filters.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index e2a177b8..d2dfb9a5 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -155,8 +155,9 @@ class Filters: def f(_, m): if m.text and m.text.startswith(_.p): - c = m.text[1:].split(_.s)[0] - m.command = ([c] + m.text.split(_.s)[1:]) if c in _.c else None + t = m.text.split(_.s) + c, a = t[0][len(_.p):], t[1:] + m.command = ([c] + a) if c in _.c else None return bool(m.command)