Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Commit

Permalink
html escaped
Browse files Browse the repository at this point in the history
  • Loading branch information
code-rgb committed Oct 24, 2020
1 parent 336c2b0 commit 032534e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions userge/plugins/utils/admins.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from userge import Message, userge
from userge.utils import mention_html
import html


@userge.on_cmd(
Expand Down Expand Up @@ -42,9 +43,9 @@ async def mentionadmins(message: Message):
if men_admins or men_creator:
owner_ += f"\n πŸ‘‘ {mention_html(u_id, full_name)}"
elif username:
owner_ += f"\n πŸ‘‘ [{full_name}](https://t.me/{username})"
owner_ += u'\n πŸ‘‘ [{}](https://t.me/{})'.format(html.escape(full_name), username)
else:
owner_ += f"\n πŸ‘‘ [{full_name}](tg://openmessage?user_id={u_id})"
owner_ += u'\n πŸ‘‘ [{}](tg://openmessage?user_id={})'.format(html.escape(full_name), u_id)
if show_id:
owner_ += f" `{u_id}`"
elif status == "administrator":
Expand All @@ -56,15 +57,15 @@ async def mentionadmins(message: Message):
if men_admins:
admins_ += f"\n β€’ {mention_html(u_id, full_name)}"
elif username:
admins_ += f"\n β€’ [{full_name}](https://t.me/{username})"
admins_ += u'\n β€’ [{}](https://t.me/{})'.format(html.escape(full_name), username)
else:
admins_ += (
f"\n β€’ [{full_name}](tg://openmessage?user_id={u_id})"
u'\n β€’ [{}](tg://openmessage?user_id={})'.format(html.escape(full_name), u_id)
)
if show_id:
admins_ += f" `{u_id}`"

mentions += f"{owner_}{admins_}{bots_}"
mentions += f"{owner_}\n{admins_}{bots_}"
except Exception as e:
mentions += " " + str(e) + "\n"
await message.edit(mentions, disable_web_page_preview=True)

1 comment on commit 032534e

@vercel
Copy link

@vercel vercel bot commented on 032534e Oct 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.