chore: clean up compile warnings

This commit is contained in:
alyssa 2025-01-02 02:37:15 +00:00
parent 16ce67e02c
commit 89d6481ddb
16 changed files with 37 additions and 32 deletions

View file

@ -165,6 +165,8 @@ public class HttpDiscordCache: IDiscordCache
// return hres;
// }
// it's fine
#pragma warning disable CS8603
public async Task<IEnumerable<Channel>> GetGuildChannels(ulong guildId)
{
var hres = await QueryCache<IEnumerable<Channel>>($"/guilds/{guildId}/channels", guildId);

View file

@ -70,7 +70,7 @@ public class ShardConnection: IAsyncDisposable
var (_, packet) = await _serializer.ReadPacket(_client);
return packet;
}
catch (Exception e)
catch (Exception)
{
// these are never useful
// _logger.Error(e, "Shard {ShardId}: Error reading from WebSocket");

View file

@ -159,7 +159,7 @@ 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) =>
public Task<RefreshedUrlsResponse?> RefreshUrls(string[] urls) =>
_client.Post<RefreshedUrlsResponse>("/attachments/refresh-urls", ("RefreshUrls", default), new RefreshUrlsRequest(urls));
private static string EncodeEmoji(Emoji emoji) =>