mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[core] add extension to convert user into loggable string
This commit is contained in:
@@ -20,5 +20,12 @@ namespace Kruzya.TelegramBot.Core.Extensions
|
|||||||
}
|
}
|
||||||
return text.Append("</a>").ToString();
|
return text.Append("</a>").ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string ToLog(this User user)
|
||||||
|
{
|
||||||
|
var name = $"{user.FirstName} {user.LastName}".Trim();
|
||||||
|
|
||||||
|
return $"{name} (ID: {user.Id}, Username: {user.Username ?? "N/A"})";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user