From 923ad100e514e5d21b95f5e15d8021531d1a2c75 Mon Sep 17 00:00:00 2001 From: spiral Date: Fri, 19 Nov 2021 07:57:01 -0500 Subject: [PATCH] lint --- Myriad/Cache/MemoryDiscordCache.cs | 2 +- Myriad/Extensions/CacheExtensions.cs | 4 ++-- PluralKit.Bot/Bot.cs | 2 +- PluralKit.Bot/Modules.cs | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Myriad/Cache/MemoryDiscordCache.cs b/Myriad/Cache/MemoryDiscordCache.cs index 68181783..4f1e1052 100644 --- a/Myriad/Cache/MemoryDiscordCache.cs +++ b/Myriad/Cache/MemoryDiscordCache.cs @@ -139,7 +139,7 @@ namespace Myriad.Cache public Task TryGetDmChannel(ulong userId) { if (!_dmChannels.TryGetValue(userId, out var channelId)) - return Task.FromResult((Channel?) null); + return Task.FromResult((Channel?)null); return TryGetChannel(channelId); } diff --git a/Myriad/Extensions/CacheExtensions.cs b/Myriad/Extensions/CacheExtensions.cs index 30d7458c..d074e987 100644 --- a/Myriad/Extensions/CacheExtensions.cs +++ b/Myriad/Extensions/CacheExtensions.cs @@ -50,7 +50,7 @@ namespace Myriad.Extensions public static async ValueTask GetOrFetchChannel(this IDiscordCache cache, DiscordApiClient rest, ulong channelId) { - if (await cache.TryGetChannel(channelId) is {} cacheChannel) + if (await cache.TryGetChannel(channelId) is { } cacheChannel) return cacheChannel; var restChannel = await rest.GetChannel(channelId); @@ -61,7 +61,7 @@ namespace Myriad.Extensions public static async Task GetOrCreateDmChannel(this IDiscordCache cache, DiscordApiClient rest, ulong recipientId) { - if (await cache.TryGetDmChannel(recipientId) is {} cacheChannel) + if (await cache.TryGetDmChannel(recipientId) is { } cacheChannel) return cacheChannel; var restChannel = await rest.CreateDm(recipientId); diff --git a/PluralKit.Bot/Bot.cs b/PluralKit.Bot/Bot.cs index 303e6df9..11d93e98 100644 --- a/PluralKit.Bot/Bot.cs +++ b/PluralKit.Bot/Bot.cs @@ -78,7 +78,7 @@ namespace PluralKit.Bot }, null, timeTillNextWholeMinute, TimeSpan.FromMinutes(1)); } - public async Task PermissionsIn(ulong channelId) + public async Task PermissionsIn(ulong channelId) { var channel = await _cache.GetRootChannel(channelId); diff --git a/PluralKit.Bot/Modules.cs b/PluralKit.Bot/Modules.cs index 396b8b79..6072a3a7 100644 --- a/PluralKit.Bot/Modules.cs +++ b/PluralKit.Bot/Modules.cs @@ -42,7 +42,8 @@ namespace PluralKit.Bot }; }).AsSelf().SingleInstance(); builder.RegisterType().AsSelf().SingleInstance(); - builder.Register(c => { + builder.Register(c => + { return new MemoryDiscordCache(); }).AsSelf().As().SingleInstance();