feat(discord): implement SendGroupMessageAsync in DiscordPlatformMessenger

This commit is contained in:
2026-05-20 12:25:07 +03:00
parent 9712fe125b
commit d871f2c142
@@ -51,9 +51,15 @@ public sealed class DiscordPlatformMessenger(
}); });
} }
public Task SendGroupMessageAsync(PlatformGroup group, string htmlText, CancellationToken ct) public async Task SendGroupMessageAsync(PlatformGroup group, string htmlText, CancellationToken ct)
{ {
return Task.CompletedTask; var channelIdStr = group.ExternalChannelId ?? group.ExternalGroupId
?? throw new InvalidOperationException("Group has no ExternalChannelId or ExternalGroupId.");
if (!ulong.TryParse(channelIdStr, out var channelId))
throw new InvalidOperationException($"Invalid Discord channel/group ID: '{channelIdStr}'.");
await restClient.SendMessageAsync(channelId, htmlText);
} }
public Task SendPrivateMessageAsync(PlatformPrivateMessage message, CancellationToken ct) public Task SendPrivateMessageAsync(PlatformPrivateMessage message, CancellationToken ct)