From c6b435c4d50fe30897763edc73f792615a7f4edb Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 21 Oct 2023 03:46:36 -0400 Subject: [PATCH] More engine generic deployment chat messages --- .../Components/Chat/Providers/DiscordProvider.cs | 9 +++++---- .../Components/Chat/Providers/IrcProvider.cs | 5 +++-- .../Components/Chat/Providers/Provider.cs | 13 +++++++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs b/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs index 7737c33f3ac..a4be368ea22 100644 --- a/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs +++ b/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs @@ -322,9 +322,10 @@ public override async ValueTask(); + var prefix = GetEngineCompilerPrefix(engineVersion.Engine.Value); var messageResponse = await channelsClient.CreateMessageAsync( new Snowflake(channelId), - "DM: Deployment in progress...", + $"{prefix}: Deployment in progress...", embeds: new List { embed }, ct: cancellationToken); @@ -371,7 +372,7 @@ public override async ValueTask CancellationTokenSource reconnectCts; + /// + /// Get the prefix for messages about deployments. + /// + /// The of the deployment. + /// The prefix. + protected static string GetEngineCompilerPrefix(Api.Models.EngineType engineType) + => engineType switch + { + Api.Models.EngineType.Byond => "DM", + Api.Models.EngineType.OpenDream => "OD", + _ => throw new InvalidOperationException($"Unsupported engine type: {engineType}"), + }; + /// /// Initializes a new instance of the class. ///