feat(discord): implement SendGroupMessageAsync in DiscordPlatformMessenger
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user