mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
zcommand: Raise error when command doesn't begin with a slash.
This commit is contained in:
@@ -6,7 +6,9 @@ from zerver.lib.actions import do_set_user_display_setting
|
||||
from zerver.lib.exceptions import JsonableError
|
||||
|
||||
def process_zcommands(content: str, user_profile: UserProfile) -> Dict[str, Any]:
|
||||
command = content.replace('/', '')
|
||||
if not content.startswith('/'):
|
||||
raise JsonableError(_('There should be a leading slash in the zcommand.'))
|
||||
command = content[1:]
|
||||
|
||||
if command == 'ping':
|
||||
ret = dict() # type: Dict[str, Any]
|
||||
|
||||
Reference in New Issue
Block a user