feat(bot): query updated signature parameters of expired discord attachments

This commit is contained in:
alyssa 2024-03-09 15:08:30 -05:00 committed by Iris System
parent caff9c50aa
commit 64c1939d71
4 changed files with 25 additions and 1 deletions

View file

@ -159,6 +159,9 @@ public class DiscordApiClient
public Task<Channel> CreateDm(ulong recipientId) =>
_client.Post<Channel>("/users/@me/channels", ("CreateDM", default), new CreateDmRequest(recipientId))!;
public Task<RefreshedUrlsResponse> RefreshUrls(string[] urls) =>
_client.Post<RefreshedUrlsResponse>("/attachments/refresh-urls", ("RefreshUrls", default), new RefreshUrlsRequest(urls));
private static string EncodeEmoji(Emoji emoji) =>
WebUtility.UrlEncode(emoji.Id != null ? $"{emoji.Name}:{emoji.Id}" : emoji.Name) ??
throw new ArgumentException("Could not encode emoji");

View file

@ -0,0 +1,3 @@
namespace Myriad.Rest.Types.Requests;
public record RefreshUrlsRequest(string[] AttachmentUrls);

View file

@ -0,0 +1,11 @@
namespace Myriad.Types;
public record RefreshedUrlsResponse
{
public record RefreshedUrl
{
public string Original;
public string Refreshed;
}
public RefreshedUrl[] RefreshedUrls;
}