Add DM support
This commit is contained in:
@@ -120,6 +120,9 @@ namespace Myriad.Rest
|
||||
_client.PostMultipart<Message>($"/webhooks/{webhookId}/{webhookToken}?wait=true",
|
||||
("ExecuteWebhook", webhookId), request, files)!;
|
||||
|
||||
public Task<Channel> CreateDm(ulong recipientId) =>
|
||||
_client.Post<Channel>($"/users/@me/channels", ("CreateDM", default), new CreateDmRequest(recipientId))!;
|
||||
|
||||
private static string EncodeEmoji(Emoji emoji) =>
|
||||
WebUtility.UrlEncode(emoji.Name) ?? emoji.Id?.ToString() ??
|
||||
throw new ArgumentException("Could not encode emoji");
|
||||
|
4
Myriad/Rest/Types/Requests/CreateDmRequest.cs
Normal file
4
Myriad/Rest/Types/Requests/CreateDmRequest.cs
Normal file
@@ -0,0 +1,4 @@
|
||||
namespace Myriad.Rest.Types.Requests
|
||||
{
|
||||
public record CreateDmRequest(ulong RecipientId);
|
||||
}
|
Reference in New Issue
Block a user