2022-08-26 13:09:33 -04:00
|
|
|
|
using Data.Models.Client;
|
|
|
|
|
using SharedLibraryCore;
|
|
|
|
|
using SharedLibraryCore.Commands;
|
|
|
|
|
using SharedLibraryCore.Configuration;
|
|
|
|
|
using SharedLibraryCore.Interfaces;
|
|
|
|
|
|
|
|
|
|
namespace Mute.Commands;
|
|
|
|
|
|
|
|
|
|
public class MuteCommand : Command
|
|
|
|
|
{
|
|
|
|
|
public MuteCommand(CommandConfiguration config, ITranslationLookup translationLookup) : base(config,
|
|
|
|
|
translationLookup)
|
|
|
|
|
{
|
|
|
|
|
Name = "mute";
|
|
|
|
|
Description = translationLookup["PLUGINS_MUTE_COMMANDS_MUTE_DESC"];
|
|
|
|
|
Alias = "mu";
|
|
|
|
|
Permission = EFClient.Permission.Moderator;
|
|
|
|
|
RequiresTarget = true;
|
|
|
|
|
SupportedGames = Plugin.SupportedGames;
|
|
|
|
|
Arguments = new[]
|
|
|
|
|
{
|
|
|
|
|
new CommandArgument
|
|
|
|
|
{
|
|
|
|
|
Name = translationLookup["COMMANDS_ARGS_PLAYER"],
|
|
|
|
|
Required = true
|
2022-10-05 16:29:31 -04:00
|
|
|
|
},
|
|
|
|
|
new CommandArgument
|
|
|
|
|
{
|
|
|
|
|
Name = translationLookup["COMMANDS_ARGS_REASON"],
|
|
|
|
|
Required = true
|
2022-08-26 13:09:33 -04:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override async Task ExecuteAsync(GameEvent gameEvent)
|
|
|
|
|
{
|
2022-10-05 16:29:31 -04:00
|
|
|
|
if (await Plugin.MuteManager.Mute(gameEvent.Owner, gameEvent.Origin, gameEvent.Target, null, gameEvent.Data))
|
2022-08-26 13:09:33 -04:00
|
|
|
|
{
|
2022-10-05 16:29:31 -04:00
|
|
|
|
gameEvent.Origin.Tell(_translationLookup["PLUGINS_MUTE_COMMANDS_MUTE_MUTED"]
|
|
|
|
|
.FormatExt(gameEvent.Target.CleanedName));
|
|
|
|
|
gameEvent.Target.Tell(_translationLookup["PLUGINS_MUTE_COMMANDS_MUTE_TARGET_MUTED"]
|
|
|
|
|
.FormatExt(gameEvent.Data));
|
2022-08-26 13:09:33 -04:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-05 16:29:31 -04:00
|
|
|
|
gameEvent.Origin.Tell(_translationLookup["PLUGINS_MUTE_COMMANDS_MUTE_NOT_UNMUTED"]
|
|
|
|
|
.FormatExt(gameEvent.Target.CleanedName));
|
2022-08-26 13:09:33 -04:00
|
|
|
|
}
|
|
|
|
|
}
|