fix: fix for username with html tags

This commit is contained in:
GiovaniFZ 2025-04-06 12:30:51 -03:00
parent 0fc4b0f217
commit 68766d5a6d
No known key found for this signature in database
GPG Key ID: 63DD92181B575322

View File

@ -196,7 +196,11 @@ function extractMetaData(meta, key) {
module.exports = (bot) => {
bot.command(['d', 'device'], spamwatchMiddleware, async (ctx) => {
const userId = ctx.from.id;
const userName = ctx.from.first_name;
let userName = String(ctx.from.first_name);
if(userName.includes("<") && userName.includes(">")) {
userName = userName.replace("<", "").replace(">", "");
}
const phone = ctx.message.text.split(" ").slice(1).join(" ");
if (!phone) {