mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
22 lines
564 B
C#
22 lines
564 B
C#
|
|
using Newtonsoft.Json;
|
||
|
|
|
||
|
|
namespace West.TelegramBot.ChatQuotes.Model;
|
||
|
|
|
||
|
|
public class User : Telegram.Bot.Types.User
|
||
|
|
{
|
||
|
|
[JsonProperty]
|
||
|
|
public string Name => LastName != null ? $"{FirstName} {LastName}" : FirstName;
|
||
|
|
|
||
|
|
public static User FromTgUser(Telegram.Bot.Types.User user)
|
||
|
|
{
|
||
|
|
return new User
|
||
|
|
{
|
||
|
|
Id = user.Id,
|
||
|
|
FirstName = user.FirstName,
|
||
|
|
LastName = user.LastName,
|
||
|
|
Username = user.Username,
|
||
|
|
LanguageCode = user.LanguageCode,
|
||
|
|
IsBot = user.IsBot
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|