/
NLObP
/
AAEmu
Обзор
Документация
Войти
/
NLObP
/
AAEmu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
AAEmu.Game/Utils/Scripts/SubCommands/World/WorldSetMotdmessageSubCommand.cs
29 строк
1 KB
ZeromusXYZ
[Game] Rewrite SendMessage to have arguments removed (#824)
24 фев 2024, 16:37
Не верифицирован
24 фев 2024, 16:37
502f5b9
Код
Авторство
О чём код?
using System.Collections.Generic; using System.Drawing; using AAEmu.Game.Core.Managers; using AAEmu.Game.Models.Game.Char; namespace AAEmu.Game.Utils.Scripts.SubCommands.World; public class WorldSetMotdmessageSubCommand : SubCommandBase { public WorldSetMotdmessageSubCommand() { Title = "[World Set MOTD]"; Description = "Setting the MOTD"; CallPrefix = $"{CommandManager.CommandPrefix}motd"; AddParameter(new StringSubCommandParameter("MOTD", "MOTD", true)); } public override void Execute(ICharacter character, string triggerArgument, IDictionary<string, ParameterValue> parameters, IMessageOutput messageOutput) { string motd = parameters["MOTD"]; if (motd is "") { SendColorMessage(messageOutput, Color.Coral, $"MOTD message must not be an empty string"); return; } character.SetMotdMessage(motd); SendMessage(messageOutput, $"Set MOTD {motd}"); Logger.Warn($"{Title}: {motd}"); } }