mirror of
https://github.com/ultrasn0w/app.git
synced 2025-12-13 19:09:53 +01:00
60 lines
1.1 KiB
C#
60 lines
1.1 KiB
C#
using System.Text;
|
|
using APP.DTO;
|
|
|
|
namespace APP.Utility;
|
|
|
|
public static class StringAssemble
|
|
{
|
|
public static string UserInfo(User? user)
|
|
{
|
|
if (user == null)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
|
|
var sb = new StringBuilder();
|
|
sb.Append("MAL ID:");
|
|
sb.AppendLine();
|
|
|
|
sb.Append("Last online:");
|
|
sb.AppendLine();
|
|
|
|
if (!string.IsNullOrEmpty(user.Location))
|
|
{
|
|
sb.Append("Location:");
|
|
sb.AppendLine();
|
|
}
|
|
|
|
sb.Append("Joined:");
|
|
sb.AppendLine();
|
|
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static string UserData(User? user)
|
|
{
|
|
if (user == null)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
|
|
var sb = new StringBuilder();
|
|
sb.Append(user.Id);
|
|
sb.AppendLine();
|
|
|
|
sb.Append(user.LastOnline);
|
|
sb.AppendLine();
|
|
|
|
if (!string.IsNullOrEmpty(user.Location))
|
|
{
|
|
sb.Append(user.Location);
|
|
sb.AppendLine();
|
|
}
|
|
|
|
sb.Append(user.Joined.ToShortDateString());
|
|
sb.AppendLine();
|
|
|
|
return sb.ToString();
|
|
}
|
|
}
|