Skip to content

Commit

Permalink
Fix: Admin-only messages still show "(S)" on Discord (space-wizards#3…
Browse files Browse the repository at this point in the history
…5431)

Fix
  • Loading branch information
Winkarst-cpu authored Feb 23, 2025
1 parent 1404095 commit 91f2c46
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Content.Server/Administration/Systems/BwoinkSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes
_gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"),
_gameTicker.RunLevel,
playedSound: playSound,
adminOnly: message.AdminOnly,
noReceivers: nonAfkAdmins.Count == 0
);
_messageQueues[msg.UserId].Enqueue(GenerateAHelpMessage(messageParams));
Expand Down Expand Up @@ -790,7 +791,7 @@ private IList<INetChannel> GetTargetAdmins()
.ToList();
}

private static DiscordRelayedData GenerateAHelpMessage(AHelpMessageParams parameters)
private DiscordRelayedData GenerateAHelpMessage(AHelpMessageParams parameters)
{
var stringbuilder = new StringBuilder();

Expand All @@ -806,7 +807,7 @@ private static DiscordRelayedData GenerateAHelpMessage(AHelpMessageParams parame
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
Expand Down Expand Up @@ -869,6 +870,7 @@ public sealed class AHelpMessageParams
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; }

Expand All @@ -879,6 +881,7 @@ public AHelpMessageParams(
string roundTime,
GameRunLevel roundState,
bool playedSound,
bool adminOnly = false,
bool noReceivers = false,
string? icon = null)
{
Expand All @@ -888,6 +891,7 @@ public AHelpMessageParams(
RoundTime = roundTime;
RoundState = roundState;
PlayedSound = playedSound;
AdminOnly = adminOnly;
NoReceivers = noReceivers;
Icon = icon;
}
Expand Down

0 comments on commit 91f2c46

Please sign in to comment.