← All source files

V18 / 8d896b8a86e5

EmailCommands.cs

Lilith/Core/Email/EmailCommands.cs

Unchanged from the preceding 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)));
    }
}