//
// ControlCommands.cs
//
// Copyright (c) František Boháček. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using OneOf.Types;
using Remora.Commands.Attributes;
using Remora.Commands.Groups;
using Remora.Results;
namespace SimplePiiBot.Commands;
///
/// Commands for controlling the bot.
///
public class ControlCommands : CommandGroup
{
private readonly Bot _bot;
///
/// Initializes a new instance of the class.
///
/// The bot.
public ControlCommands(Bot bot)
{
_bot = bot;
}
///
/// Handle the start command.
///
/// A result that may or may not succeed.
[Command("start")]
public async Task HandleStartAsync()
=> await _bot.StartAsync(CancellationToken);
///
/// Handle the stop command.
///
/// A result that may or may not succeed.
[Command("stop")]
public async Task HandleStopAsync()
=> await _bot.StopAsync(CancellationToken);
}