← All source files

V13 / 7879e8b5740b

EmailCommands.cs

Lilith/Core/Email/EmailCommands.cs

Changed in this version
CS
using Lilith.Core.Commands;

namespace Lilith.Core.Email;

public static class EmailCommands
{
    public static void Register(ChatCommandRegistry commands, Func<ProviderClient> provider)
    {
        commands.Register("email-mode", "Show email mode, or choose unread / since_last_check. No mailbox is read.", c =>
        {
            if (!string.IsNullOrWhiteSpace(c.Arguments)) provider().SetEmailMode(c.Arguments);
            return "Email mode: " + provider().EmailMode;
        });
        commands.RegisterAsync("email-confirm", "Apply the exact pending local sender rule: /email-confirm ID. Gmail stays unchanged.", async c => new(true, await provider().ConfirmEmailRuleAsync(c.Arguments, c.CancellationToken)));
    }
}