mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[quote] Crappy chat quote implementation.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System.Globalization;
|
||||
using Kruzya.TelegramBot.Core;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using West.TelegramBot.ChatQuotes.Json;
|
||||
|
||||
namespace West.TelegramBot.ChatQuotes
|
||||
{
|
||||
public class ChatQuotes : Module
|
||||
{
|
||||
public static readonly JsonSerializerSettings SerializerSettings = new()
|
||||
{
|
||||
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
||||
DateParseHandling = DateParseHandling.None,
|
||||
Converters =
|
||||
{
|
||||
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal },
|
||||
new StringEnumConverter(new CamelCaseNamingStrategy())
|
||||
},
|
||||
ContractResolver = new NullToEmptyObjectResolver()
|
||||
};
|
||||
|
||||
public ChatQuotes(Core core) : base(core) { }
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<QuoteGeneratorService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user