This repository has been archived on 2024-12-22. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
elliebot/src/EllieBot/Modules/Games/ChatterBot/ChatterBotCommands.cs

34 lines
No EOL
866 B
C#

#nullable disable
using EllieBot.Modules.Games.Services;
namespace EllieBot.Modules.Games;
public partial class Games
{
[Group]
public partial class ChatterBotCommands : EllieModule<ChatterBotService>
{
private readonly DbService _db;
public ChatterBotCommands(DbService db)
=> _db = db;
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.ManageMessages)]
public async Task CleverBot()
{
var channel = (ITextChannel)ctx.Channel;
var newState = await _service.ToggleChatterBotAsync(ctx.Guild.Id);
if (!newState)
{
await Response().Confirm(strs.chatbot_disabled).SendAsync();
return;
}
await Response().Confirm(strs.chatbot_enabled).SendAsync();
}
}
}