dokku-comp

This commit is contained in:
2023-09-11 23:04:53 +03:00
parent 4be2dc3a45
commit b9a98f1e56
25 changed files with 646 additions and 460 deletions

View File

@@ -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