From 91f2c46f5669b86fbb3524c4baaa867d975780aa Mon Sep 17 00:00:00 2001 From: Winkarst <74284083+Winkarst-cpu@users.noreply.github.com> Date: Mon, 24 Feb 2025 00:43:14 +0300 Subject: [PATCH] Fix: Admin-only messages still show "(S)" on Discord (#35431) Fix --- Content.Server/Administration/Systems/BwoinkSystem.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Content.Server/Administration/Systems/BwoinkSystem.cs b/Content.Server/Administration/Systems/BwoinkSystem.cs index b3039e92ff..2df9aa9fcc 100644 --- a/Content.Server/Administration/Systems/BwoinkSystem.cs +++ b/Content.Server/Administration/Systems/BwoinkSystem.cs @@ -759,6 +759,7 @@ namespace Content.Server.Administration.Systems _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel, playedSound: playSound, + adminOnly: message.AdminOnly, noReceivers: nonAfkAdmins.Count == 0 ); _messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(messageParams)); @@ -790,7 +791,7 @@ namespace Content.Server.Administration.Systems .ToList(); } - private static DiscordRelayedData GenerateAHelpMessage(AHelpMessageParams parameters) + private DiscordRelayedData GenerateAHelpMessage(AHelpMessageParams parameters) { var stringbuilder = new StringBuilder(); @@ -806,7 +807,7 @@ namespace Content.Server.Administration.Systems if (parameters.RoundTime != string.Empty && parameters.RoundState == GameRunLevel.InRound) stringbuilder.Append($" **{parameters.RoundTime}**"); if (!parameters.PlayedSound) - stringbuilder.Append(" **(S)**"); + stringbuilder.Append($" **{(parameters.AdminOnly ? Loc.GetString("bwoink-message-admin-only") : Loc.GetString("bwoink-message-silent"))}**"); if (parameters.Icon == null) stringbuilder.Append($" **{parameters.Username}:** "); else @@ -869,6 +870,7 @@ namespace Content.Server.Administration.Systems public string RoundTime { get; set; } public GameRunLevel RoundState { get; set; } public bool PlayedSound { get; set; } + public readonly bool AdminOnly; public bool NoReceivers { get; set; } public string? Icon { get; set; } @@ -879,6 +881,7 @@ namespace Content.Server.Administration.Systems string roundTime, GameRunLevel roundState, bool playedSound, + bool adminOnly = false, bool noReceivers = false, string? icon = null) { @@ -888,6 +891,7 @@ namespace Content.Server.Administration.Systems RoundTime = roundTime; RoundState = roundState; PlayedSound = playedSound; + AdminOnly = adminOnly; NoReceivers = noReceivers; Icon = icon; }