mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
35 lines
924 B
C#
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);
|
|
}
|
|
} |