From 59f253d0872741bf99ad274415b16f3b84b36a71 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 22 Nov 2020 13:54:34 -0500 Subject: [PATCH] [+] touch: Validate name is alphanumeric --- src/commands.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/commands.py b/src/commands.py index 56f79fa..2bddbca 100644 --- a/src/commands.py +++ b/src/commands.py @@ -41,6 +41,15 @@ def touch(update, context): chat = update.effective_chat user = database.checkUser(chat.id) + # No args + if len(context.args) != 2: + return "用法: /touch " + + # Validate name + name = context.args[0] + if not name.isalnum(): + return "只能有数字或者字母哦w" + def rm(update, context): chat = update.effective_chat