Files
telegram-bot/modules/ChatQuotes/Model/Quote/Request.cs
T
2022-01-21 14:18:56 +02:00

35 lines
924 B
C#

#nullable enable
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace West.TelegramBot.ChatQuotes.Model.Quote;
[JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class Request
{
public Request(Telegram.Bot.Types.Message msg)
{
// TODO: move default values to config
Format = "webp";
BackgroundColor = "#1b1429";
Width = 512;
Height = 768;
Scale = 2;
Messages = new List<Message> {Message.FromMessage(msg)};
}
public Type Type { get; set; }
public string Format { get; set; }
public string BackgroundColor { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public int Scale { get; set; }
public List<Message>? Messages { get; set; }
public string ToJson()
{
return JsonConvert.SerializeObject(this, ChatQuotes.SerializerSettings);
}
}