1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-29 18:49:53 +03:00

start working on /ban command

This commit is contained in:
nrdk 2023-06-08 17:29:45 +05:00 committed by Octol1ttle
parent 91516a899c
commit a83aa03cf0
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
3 changed files with 55 additions and 7 deletions

36
Commands/BanCommand.cs Normal file
View file

@ -0,0 +1,36 @@
using System.ComponentModel;
using Remora.Commands.Attributes;
using Remora.Commands.Groups;
using Remora.Discord.API.Abstractions.Objects;
using Remora.Discord.API.Gateway.Events;
using Remora.Discord.API.Objects;
using Remora.Discord.Commands.Attributes;
using Remora.Discord.Commands.Feedback.Services;
using Remora.Rest.Core;
using Remora.Results;
namespace Boyfriend.Commands;
public class BanCommand : CommandGroup{
private readonly FeedbackService _feedbackService;
/// <summary>
/// Initializes a new instance of the <see cref="HttpCatCommands"/> class.
/// </summary>
/// <param name="feedbackService">The feedback service.</param>
public BanCommand(FeedbackService feedbackService)
{
_feedbackService = feedbackService;
}
[Command("ban")]
[Description("банит пидора")]
public async Task<IResult> BanAsync([Description("Юзер, кого банить")] IUser user, string reason) {
var banan = new Ban(reason, user);
var embed = new Embed(Colour: _feedbackService.Theme.Secondary, Description: "забанен нахуй");
return (Result)await _feedbackService.SendContextualEmbedAsync(embed, ct: this.CancellationToken);
}
}