mirror of
https://github.com/Jetsparrow/antiantiswearingbot.git
synced 2026-01-21 07:16:08 +03:00
26 lines
624 B
C#
26 lines
624 B
C#
using Jetsparrow.Aasb.Services;
|
||
|
||
namespace Jetsparrow.Aasb.Commands;
|
||
public class UnlearnCommand : IChatCommand
|
||
{
|
||
public bool Authorize => true;
|
||
SearchDictionary Dict { get; }
|
||
|
||
public UnlearnCommand(SearchDictionary dict)
|
||
{
|
||
Dict = dict;
|
||
}
|
||
|
||
public string Execute(CommandContext cmd)
|
||
{
|
||
var word = cmd.Parameters.FirstOrDefault();
|
||
if (string.IsNullOrWhiteSpace(word))
|
||
return null;
|
||
|
||
if (Dict.Unlearn(word))
|
||
return $"Больше не буду";
|
||
else
|
||
return $"А я и не знаю что такое \"{word}\"";
|
||
}
|
||
}
|