mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 09:40:10 +00:00
Add DM support
This commit is contained in:
parent
2e0c30eb5d
commit
a2c8cbb560
9 changed files with 79 additions and 45 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue