Fix Bridge embeds not functioning

This commit is contained in:
Dominion
2023-03-28 03:01:56 -04:00
parent b02f2e0c6a
commit e3bb29ee48
4 changed files with 13 additions and 10 deletions
@@ -323,7 +323,7 @@ namespace Tgstation.Server.Host.Components.Chat
}
/// <inheritdoc />
public void QueueMessage(string message, IEnumerable<ulong> channelIds)
public void QueueMessage(MessageContent message, IEnumerable<ulong> channelIds)
{
if (message == null)
throw new ArgumentNullException(nameof(message));
@@ -333,10 +333,7 @@ namespace Tgstation.Server.Host.Components.Chat
var task = SendMessage(
channelIds,
null,
new MessageContent
{
Text = message,
},
message,
handlerCts.Token);
AddMessageTask(task);
}
@@ -356,7 +353,12 @@ namespace Tgstation.Server.Host.Components.Chat
lock (mappedChannels)
wdChannels = mappedChannels.Where(x => x.Value.IsWatchdogChannel).Select(x => x.Key).ToList();
QueueMessage(message, wdChannels);
QueueMessage(
new MessageContent
{
Text = message
},
wdChannels);
}
/// <inheritdoc />
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Tgstation.Server.Api.Models.Internal;
using Tgstation.Server.Host.Components.Interop;
namespace Tgstation.Server.Host.Components.Chat
{
@@ -48,9 +49,9 @@ namespace Tgstation.Server.Host.Components.Chat
/// <summary>
/// Queue a chat <paramref name="message"/> to a given set of <paramref name="channelIds"/>.
/// </summary>
/// <param name="message">The message being sent.</param>
/// <param name="message">The <see cref="MessageContent"/> being sent.</param>
/// <param name="channelIds">The <see cref="Models.ChatChannel.Id"/>s of the <see cref="Models.ChatChannel"/>s to send to.</param>
void QueueMessage(string message, IEnumerable<ulong> channelIds);
void QueueMessage(MessageContent message, IEnumerable<ulong> channelIds);
/// <summary>
/// Queue a chat <paramref name="message"/> to configured watchdog channels.
@@ -321,7 +321,7 @@ namespace Tgstation.Server.Host.Components.Session
return Error("Missing message field in chatMessage!");
chat.QueueMessage(
parameters.ChatMessage.Text,
parameters.ChatMessage,
parameters.ChatMessage.ChannelIds.Select(UInt64.Parse));
break;
case BridgeCommandType.Prime:
@@ -468,7 +468,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
if (result?.InteropResponse?.ChatResponses != null)
foreach (var response in result.InteropResponse.ChatResponses)
Chat.QueueMessage(
response.Text,
response,
response.ChannelIds
.Select(channelIdString =>
{