Added .exprtoggleglobal / .extg which can be used to toggle usage of global expressions on the server

This commit is contained in:
Kwoth
2022-10-21 21:31:59 +02:00
parent bfec0cbcbf
commit cb98f4aa15
18 changed files with 10443 additions and 26 deletions

View File

@@ -0,0 +1,28 @@
#nullable disable
using Nadeko.Common;
using NadekoBot.Services.Database.Models;
namespace NadekoBot.Modules.NadekoExpressions;
public class ExportedExpr
{
public string Res { get; set; }
public string Id { get; set; }
public bool Ad { get; set; }
public bool Dm { get; set; }
public bool At { get; set; }
public bool Ca { get; set; }
public string[] React;
public static ExportedExpr FromModel(NadekoExpression cr)
=> new()
{
Res = cr.Response,
Id = ((kwum)cr.Id).ToString(),
Ad = cr.AutoDeleteTrigger,
At = cr.AllowTarget,
Ca = cr.ContainsAnywhere,
Dm = cr.DmResponse,
React = string.IsNullOrWhiteSpace(cr.Reactions) ? null : cr.GetReactions()
};
}