From 25f249ab5ec8febda30e7dafc400be43494a2486 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sun, 2 Jan 2022 04:16:34 +0100 Subject: [PATCH] More cleanup and restructuring, nothing of note --- .../Gambling/{~Shared => }/GamblingConfig.cs | 0 .../{~Shared => }/GamblingTopLevelModule.cs | 0 .../Gambling/{~Shared => Slot}/SlotResponse.cs | 0 .../Modules/Gambling/VoteRewardService.cs | 14 +++++--------- src/NadekoBot/data/aliases.yml | 1 - 5 files changed, 5 insertions(+), 10 deletions(-) rename src/NadekoBot/Modules/Gambling/{~Shared => }/GamblingConfig.cs (100%) rename src/NadekoBot/Modules/Gambling/{~Shared => }/GamblingTopLevelModule.cs (100%) rename src/NadekoBot/Modules/Gambling/{~Shared => Slot}/SlotResponse.cs (100%) diff --git a/src/NadekoBot/Modules/Gambling/~Shared/GamblingConfig.cs b/src/NadekoBot/Modules/Gambling/GamblingConfig.cs similarity index 100% rename from src/NadekoBot/Modules/Gambling/~Shared/GamblingConfig.cs rename to src/NadekoBot/Modules/Gambling/GamblingConfig.cs diff --git a/src/NadekoBot/Modules/Gambling/~Shared/GamblingTopLevelModule.cs b/src/NadekoBot/Modules/Gambling/GamblingTopLevelModule.cs similarity index 100% rename from src/NadekoBot/Modules/Gambling/~Shared/GamblingTopLevelModule.cs rename to src/NadekoBot/Modules/Gambling/GamblingTopLevelModule.cs diff --git a/src/NadekoBot/Modules/Gambling/~Shared/SlotResponse.cs b/src/NadekoBot/Modules/Gambling/Slot/SlotResponse.cs similarity index 100% rename from src/NadekoBot/Modules/Gambling/~Shared/SlotResponse.cs rename to src/NadekoBot/Modules/Gambling/Slot/SlotResponse.cs diff --git a/src/NadekoBot/Modules/Gambling/VoteRewardService.cs b/src/NadekoBot/Modules/Gambling/VoteRewardService.cs index ff8ddbda5..96f6bb4e9 100644 --- a/src/NadekoBot/Modules/Gambling/VoteRewardService.cs +++ b/src/NadekoBot/Modules/Gambling/VoteRewardService.cs @@ -15,21 +15,17 @@ public class VoteRewardService : INService, IReadyExecutor { private readonly DiscordSocketClient _client; private readonly IBotCredentials _creds; - private readonly IHttpClientFactory _httpClientFactory; private readonly ICurrencyService _currencyService; private readonly GamblingConfigService _gamb; - private HttpClient _http; public VoteRewardService( DiscordSocketClient client, IBotCredentials creds, - IHttpClientFactory httpClientFactory, ICurrencyService currencyService, GamblingConfigService gamb) { _client = client; _creds = creds; - _httpClientFactory = httpClientFactory; _currencyService = currencyService; _gamb = gamb; } @@ -39,7 +35,7 @@ public class VoteRewardService : INService, IReadyExecutor if (_client.ShardId != 0) return; - _http = new(new HttpClientHandler + var http = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false, ServerCertificateCustomValidationCallback = delegate { return true; } }); @@ -55,9 +51,9 @@ public class VoteRewardService : INService, IReadyExecutor { if (!string.IsNullOrWhiteSpace(topggKey) && !string.IsNullOrWhiteSpace(topggServiceUrl)) { - _http.DefaultRequestHeaders.Authorization = new(topggKey); + http.DefaultRequestHeaders.Authorization = new(topggKey); var uri = new Uri(new(topggServiceUrl), "topgg/new"); - var res = await _http.GetStringAsync(uri); + var res = await http.GetStringAsync(uri); var data = JsonSerializer.Deserialize>(res); if (data is { Count: > 0 }) @@ -85,8 +81,8 @@ public class VoteRewardService : INService, IReadyExecutor { if (!string.IsNullOrWhiteSpace(discordsKey) && !string.IsNullOrWhiteSpace(discordsServiceUrl)) { - _http.DefaultRequestHeaders.Authorization = new(discordsKey); - var res = await _http.GetStringAsync(new Uri(new(discordsServiceUrl), "discords/new")); + http.DefaultRequestHeaders.Authorization = new(discordsKey); + var res = await http.GetStringAsync(new Uri(new(discordsServiceUrl), "discords/new")); var data = JsonSerializer.Deserialize>(res); if (data is { Count: > 0 }) diff --git a/src/NadekoBot/data/aliases.yml b/src/NadekoBot/data/aliases.yml index ea44fce89..197a5c26b 100644 --- a/src/NadekoBot/data/aliases.yml +++ b/src/NadekoBot/data/aliases.yml @@ -112,7 +112,6 @@ delcustreact: - dcr - exprdel - exd -- exd crclear: - crclear - exclear