mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Merge remote-tracking branch 'origin/feature/warns-net5' into feature/new-dotnet-5
This commit is contained in:
@@ -5,17 +5,20 @@ namespace Kruzya.TelegramBot.Core.Extensions
|
||||
{
|
||||
public static class UserExtension
|
||||
{
|
||||
public static string ToHtml(this User user)
|
||||
public static string ToHtml(this User user, bool byUsername = true)
|
||||
{
|
||||
var text = new StringBuilder();
|
||||
text.Append($"<a href=\"tg://user?id={user.Id}\">");
|
||||
if (!string.IsNullOrWhiteSpace(user.Username))
|
||||
|
||||
if (byUsername && !string.IsNullOrWhiteSpace(user.Username))
|
||||
{
|
||||
text.Append(user.Username);
|
||||
}
|
||||
else
|
||||
{
|
||||
text.Append($"{user.FirstName} {user.LastName}".Trim().HtmlEncode());
|
||||
text.Append("</a>");
|
||||
|
||||
return text.ToString();
|
||||
}
|
||||
return text.Append("</a>").ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
|
||||
"BotConfig": {
|
||||
"token": "5093569980:AAEnrlpg2VYD0CyQYIZtWpUuRrlpkDG8NaI"
|
||||
},
|
||||
|
||||
"ModuleDirectories": [
|
||||
"C:\\Users\\Andriy\\RiderProjects\\telegram-bot\\modules\\Destiny2.WhereIsXur\\bin\\Debug\\net5.0",
|
||||
"C:\\Users\\Andriy\\RiderProjects\\telegram-bot\\modules\\RichSiteSummary\\bin\\Debug\\net5.0"
|
||||
],
|
||||
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "server=127.0.0.1;UserId=root;Password=;database=kruzyatgbot-core;port=3306",
|
||||
"RichSiteSummary": "server=127.0.0.1;UserId=root;Password=;database=kruzyatgbot-rss;port=3306"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user