mirror of
https://github.com/ultrasn0w/app.git
synced 2025-12-13 23:39:52 +01:00
First stuff
This commit is contained in:
59
APP/Utility/StringAssemble.cs
Normal file
59
APP/Utility/StringAssemble.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user