dokku-comp
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
def escape_username(username):
|
||||
# Replace any non-ASCII and non-alphanumeric characters with underscores
|
||||
return ''.join(c if c.isalnum() or c.isspace() else '-' for c in username)
|
||||
return "".join(c if c.isalnum() or c.isspace() else "-" for c in username)
|
||||
|
||||
|
||||
# generates a mention from standard telegram web json 'from' field
|
||||
# using HTML markup
|
||||
@@ -12,9 +13,8 @@ def mention(user):
|
||||
|
||||
def userdata_extract(user):
|
||||
identity = f"{user['first_name']} {user.get('last_name', '')}".strip()
|
||||
uid = user['id']
|
||||
username = user.get('username', '')
|
||||
uid = user["id"]
|
||||
username = user.get("username", "")
|
||||
if username:
|
||||
username = f'(@{username})'
|
||||
username = f"(@{username})"
|
||||
return uid, identity, username
|
||||
|
||||
|
Reference in New Issue
Block a user