From 2d2a7f765fe521d280a81dac0f2fcb62375ddd61 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sun, 1 Jan 2017 13:57:38 +0100 Subject: [PATCH] A lot of fixes to constructors --- .../Modules/Administration/Administration.cs | 4 -- .../Administration/Commands/LogCommand.cs | 43 +++++++------------ .../Administration/Commands/Migration.cs | 4 +- .../Administration/Commands/SelfCommands.cs | 13 ++---- .../CustomReactions/CustomReactions.cs | 3 -- .../Modules/Gambling/Commands/DrawCommand.cs | 9 +--- .../Modules/Games/Commands/HangmanCommands.cs | 6 +-- .../Games/Commands/SpeedTypingCommands.cs | 8 +--- src/NadekoBot/Modules/Music/Music.cs | 9 ++-- src/NadekoBot/Modules/NSFW/NSFW.cs | 4 -- .../Modules/Permissions/Permissions.cs | 4 -- src/NadekoBot/Modules/Pokemon/Pokemon.cs | 8 ++-- .../Searches/Commands/PlaceCommands.cs | 6 +-- .../Modules/Utility/Commands/Remind.cs | 10 ++--- .../Utility/Commands/UnitConversion.cs | 6 +-- src/NadekoBot/Modules/Utility/Utility.cs | 5 --- 16 files changed, 38 insertions(+), 104 deletions(-) diff --git a/src/NadekoBot/Modules/Administration/Administration.cs b/src/NadekoBot/Modules/Administration/Administration.cs index 18e7a7a7..70aadf8a 100644 --- a/src/NadekoBot/Modules/Administration/Administration.cs +++ b/src/NadekoBot/Modules/Administration/Administration.cs @@ -29,10 +29,6 @@ namespace NadekoBot.Modules.Administration private new static Logger _log { get; } - public Administration() : base() - { - } - static Administration() { _log = LogManager.GetCurrentClassLogger(); diff --git a/src/NadekoBot/Modules/Administration/Commands/LogCommand.cs b/src/NadekoBot/Modules/Administration/Commands/LogCommand.cs index 2bcfb403..04bde59b 100644 --- a/src/NadekoBot/Modules/Administration/Commands/LogCommand.cs +++ b/src/NadekoBot/Modules/Administration/Commands/LogCommand.cs @@ -67,10 +67,7 @@ namespace NadekoBot.Modules.Administration sw.Stop(); _log.Debug($"Loaded in {sw.Elapsed.TotalSeconds:F2}s"); - } - public LogCommands() - { //_client.MessageReceived += _client_MessageReceived; _client.MessageUpdated += _client_MessageUpdated; _client.MessageDeleted += _client_MessageDeleted; @@ -91,7 +88,7 @@ namespace NadekoBot.Modules.Administration MuteCommands.UserUnmuted += MuteCommands_UserUnmuted; } - private async void _client_UserVoiceStateUpdated_TTS(SocketUser iusr, SocketVoiceState before, SocketVoiceState after) + private static async void _client_UserVoiceStateUpdated_TTS(SocketUser iusr, SocketVoiceState before, SocketVoiceState after) { try { @@ -133,7 +130,7 @@ namespace NadekoBot.Modules.Administration catch { } } - private async void MuteCommands_UserMuted(IGuildUser usr, MuteCommands.MuteType muteType) + private static async void MuteCommands_UserMuted(IGuildUser usr, MuteCommands.MuteType muteType) { try { @@ -163,7 +160,7 @@ namespace NadekoBot.Modules.Administration catch (Exception ex) { _log.Warn(ex); } } - private async void MuteCommands_UserUnmuted(IGuildUser usr, MuteCommands.MuteType muteType) + private static async void MuteCommands_UserUnmuted(IGuildUser usr, MuteCommands.MuteType muteType) { try { @@ -226,13 +223,12 @@ namespace NadekoBot.Modules.Administration //punishment = "BANNED"; } await logChannel.SendMessageAsync(String.Join("\n", users.Select(user => $"‼️ {Format.Bold(user.ToString())} got **{punishment}** due to __**{protection}**__ protection on **{user.Guild.Name}** server."))) - //await logChannel.SendMessageAsync(String.Join("\n",users.Select(user=>$"{Format.Bold(user.ToString())} was **{punishment}** due to `{protection}` protection on **{user.Guild.Name}** server."))) .ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } } - private async void _client_UserUpdated(SocketUser uBefore, SocketUser uAfter) + private static async void _client_UserUpdated(SocketUser uBefore, SocketUser uAfter) { try { @@ -254,26 +250,21 @@ namespace NadekoBot.Modules.Administration string str = $"🕔`{prettyCurrentTime}`"; if (before.Username != after.Username) - //str += $"**Name Changed**`{before.Username}#{before.Discriminator}`\n\t\t`New:`{after.ToString()}`"; str += $"👤__**{before.Username}#{before.Discriminator}**__ **| Name Changed |** 🆔 `{before.Id}`\n\t\t`New:` **{after.ToString()}**"; else if (before.Nickname != after.Nickname) str += $"👤__**{before.Username}#{before.Discriminator}**__ **| Nickname Changed |** 🆔 `{before.Id}`\n\t\t`Old:` **{before.Nickname}#{before.Discriminator}**\n\t\t`New:` **{after.Nickname}#{after.Discriminator}**"; - //str += $"**Nickname Changed**`{before.Username}#{before.Discriminator}`\n\t\t`Old:` {before.Nickname}#{before.Discriminator}\n\t\t`New:` {after.Nickname}#{after.Discriminator}"; else if (before.AvatarUrl != after.AvatarUrl) - //str += $"**Avatar Changed**👤`{before.Username}#{before.Discriminator}`\n\t {await _google.ShortenUrl(before.AvatarUrl)} `=>` {await _google.ShortenUrl(after.AvatarUrl)}"; - str += $"👤__**{before.Username}#{before.Discriminator}**__ **| Avatar Changed |** 🆔 `{before.Id}`\n\t🖼 {await _google.ShortenUrl(before.AvatarUrl)} `=>` {await _google.ShortenUrl(after.AvatarUrl)}"; + str += $"👤__**{before.Username}#{before.Discriminator}**__ **| Avatar Changed |** 🆔 `{before.Id}`\n\t🖼 {await NadekoBot.Google.ShortenUrl(before.AvatarUrl)} `=>` {await NadekoBot.Google.ShortenUrl(after.AvatarUrl)}"; else if (!before.RoleIds.SequenceEqual(after.RoleIds)) { if (before.RoleIds.Count < after.RoleIds.Count) { var diffRoles = after.RoleIds.Where(r => !before.RoleIds.Contains(r)).Select(r => "**" + before.Guild.GetRole(r).Name + "**"); - //str += $"**User's Roles changed ⚔➕**👤`{before.ToString()}`\n\tNow has {string.Join(", ", diffRoles)} role."; str += $"👤__**{before.ToString()}**__ **| User's Role Added |** 🆔 `{before.Id}`\n\t✅ {string.Join(", ", diffRoles).SanitizeMentions()}\n\t\t⚔ **`{string.Join(", ", after.GetRoles().Select(r => r.Name)).SanitizeMentions()}`** ⚔"; } else if (before.RoleIds.Count > after.RoleIds.Count) { var diffRoles = before.RoleIds.Where(r => !after.RoleIds.Contains(r)).Select(r => "**" + before.Guild.GetRole(r).Name + "**"); - //str += $"**User's Roles changed **`{before.ToString()}`\n\tNo longer has {string.Join(", ", diffRoles)} role."; str += $"👤__**{before.ToString()}**__ **| User's Role Removed |** 🆔 `{before.Id}`\n\t🚮 {string.Join(", ", diffRoles).SanitizeMentions()}\n\t\t⚔ **`{string.Join(", ", after.GetRoles().Select(r => r.Name)).SanitizeMentions()}`** ⚔"; } } @@ -284,7 +275,7 @@ namespace NadekoBot.Modules.Administration catch (Exception ex) { _log.Warn(ex); } } - private async void _client_ChannelUpdated(IChannel cbefore, IChannel cafter) + private static async void _client_ChannelUpdated(IChannel cbefore, IChannel cafter) { try { @@ -303,12 +294,10 @@ namespace NadekoBot.Modules.Administration if ((logChannel = await TryGetLogChannel(before.Guild, logSetting, LogType.ChannelUpdated)) == null) return; if (before.Name != after.Name) - //await logChannel.SendMessageAsync($@"`{prettyCurrentTime}` **Channel Name Changed** `#{after.Name}` ({after.Id}) await logChannel.SendMessageAsync($@"🕓`{prettyCurrentTime}`ℹ️ **| Channel Name Changed |** #⃣ `{after.Name} ({after.Id})` `Old:` {before.Name} **`New:`** {after.Name}").ConfigureAwait(false); else if ((before as ITextChannel).Topic != (after as ITextChannel).Topic) - //await logChannel.SendMessageAsync($@"`{prettyCurrentTime}` **Channel Topic Changed** `#{after.Name}` ({after.Id}) await logChannel.SendMessageAsync($@"🕘`{prettyCurrentTime}`ℹ️ **| Channel Topic Changed |** #⃣ `{after.Name} ({after.Id})` `Old:` {((ITextChannel)before).Topic} **`New:`** {((ITextChannel)after).Topic}").ConfigureAwait(false); @@ -316,7 +305,7 @@ namespace NadekoBot.Modules.Administration catch (Exception ex) { _log.Warn(ex); } } - private async void _client_ChannelDestroyed(IChannel ich) + private static async void _client_ChannelDestroyed(IChannel ich) { try { @@ -339,7 +328,7 @@ namespace NadekoBot.Modules.Administration catch (Exception ex) { _log.Warn(ex); } } - private async void _client_ChannelCreated(IChannel ich) + private static async void _client_ChannelCreated(IChannel ich) { try { @@ -361,7 +350,7 @@ namespace NadekoBot.Modules.Administration catch (Exception ex) { _log.Warn(ex); } } - private async void _client_UserVoiceStateUpdated(SocketUser iusr, SocketVoiceState before, SocketVoiceState after) + private static async void _client_UserVoiceStateUpdated(SocketUser iusr, SocketVoiceState before, SocketVoiceState after) { try { @@ -406,7 +395,7 @@ namespace NadekoBot.Modules.Administration } } - private async void _client_UserPresenceUpdated(Optional optGuild, SocketUser usr, SocketPresence before, SocketPresence after) + private static async void _client_UserPresenceUpdated(Optional optGuild, SocketUser usr, SocketPresence before, SocketPresence after) { try { @@ -435,7 +424,7 @@ namespace NadekoBot.Modules.Administration catch { } } - private async void _client_UserLeft(IGuildUser usr) + private static async void _client_UserLeft(IGuildUser usr) { try { @@ -452,7 +441,7 @@ namespace NadekoBot.Modules.Administration catch { } } - private async void _client_UserJoined(IGuildUser usr) + private static async void _client_UserJoined(IGuildUser usr) { try { @@ -470,7 +459,7 @@ namespace NadekoBot.Modules.Administration catch (Exception ex) { _log.Warn(ex); } } - private async void _client_UserUnbanned(IUser usr, IGuild guild) + private static async void _client_UserUnbanned(IUser usr, IGuild guild) { try { @@ -488,7 +477,7 @@ namespace NadekoBot.Modules.Administration catch (Exception ex) { _log.Warn(ex); } } - private async void _client_UserBanned(IUser usr, IGuild guild) + private static async void _client_UserBanned(IUser usr, IGuild guild) { try { @@ -505,7 +494,7 @@ namespace NadekoBot.Modules.Administration catch (Exception ex) { _log.Warn(ex); } } - private async void _client_MessageDeleted(ulong arg1, Optional imsg) + private static async void _client_MessageDeleted(ulong arg1, Optional imsg) { try @@ -536,7 +525,7 @@ namespace NadekoBot.Modules.Administration catch (Exception ex) { _log.Warn(ex); } } - private async void _client_MessageUpdated(Optional optmsg, SocketMessage imsg2) + private static async void _client_MessageUpdated(Optional optmsg, SocketMessage imsg2) { try { diff --git a/src/NadekoBot/Modules/Administration/Commands/Migration.cs b/src/NadekoBot/Modules/Administration/Commands/Migration.cs index 4e7bf469..433cfc7b 100644 --- a/src/NadekoBot/Modules/Administration/Commands/Migration.cs +++ b/src/NadekoBot/Modules/Administration/Commands/Migration.cs @@ -24,9 +24,9 @@ namespace NadekoBot.Modules.Administration { private const int CURRENT_VERSION = 1; - private Logger _log { get; } + private static Logger _log { get; } - public Migration() + static Migration() { _log = LogManager.GetCurrentClassLogger(); } diff --git a/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs b/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs index 04d9f61c..6e76fd1a 100644 --- a/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs +++ b/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs @@ -11,28 +11,21 @@ namespace NadekoBot.Modules.Administration [Group] class SelfCommands : ModuleBase { - private ShardedDiscordClient _client; - - public SelfCommands() - { - this._client = NadekoBot.Client; - } - [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] [OwnerOnly] public async Task Leave([Remainder] string guildStr) { guildStr = guildStr.Trim().ToUpperInvariant(); - var server = _client.GetGuilds().FirstOrDefault(g => g.Id.ToString().Trim().ToUpperInvariant() == guildStr) ?? - _client.GetGuilds().FirstOrDefault(g => g.Name.Trim().ToUpperInvariant() == guildStr); + var server = NadekoBot.Client.GetGuilds().FirstOrDefault(g => g.Id.ToString().Trim().ToUpperInvariant() == guildStr) ?? + NadekoBot.Client.GetGuilds().FirstOrDefault(g => g.Name.Trim().ToUpperInvariant() == guildStr); if (server == null) { await Context.Channel.SendErrorAsync("⚠️ Cannot find that server").ConfigureAwait(false); return; } - if (server.OwnerId != _client.CurrentUser().Id) + if (server.OwnerId != NadekoBot.Client.CurrentUser().Id) { await server.LeaveAsync().ConfigureAwait(false); await Context.Channel.SendConfirmAsync("✅ Left server " + server.Name).ConfigureAwait(false); diff --git a/src/NadekoBot/Modules/CustomReactions/CustomReactions.cs b/src/NadekoBot/Modules/CustomReactions/CustomReactions.cs index 7b331bd7..26a1b902 100644 --- a/src/NadekoBot/Modules/CustomReactions/CustomReactions.cs +++ b/src/NadekoBot/Modules/CustomReactions/CustomReactions.cs @@ -36,9 +36,6 @@ namespace NadekoBot.Modules.CustomReactions sw.Stop(); _log.Debug($"Loaded in {sw.Elapsed.TotalSeconds:F2}s"); } - public CustomReactions() : base() - { - } public void ClearStats() => ReactionStats.Clear(); diff --git a/src/NadekoBot/Modules/Gambling/Commands/DrawCommand.cs b/src/NadekoBot/Modules/Gambling/Commands/DrawCommand.cs index a57a4872..adbe4913 100644 --- a/src/NadekoBot/Modules/Gambling/Commands/DrawCommand.cs +++ b/src/NadekoBot/Modules/Gambling/Commands/DrawCommand.cs @@ -21,14 +21,7 @@ namespace NadekoBot.Modules.Gambling { private static readonly ConcurrentDictionary AllDecks = new ConcurrentDictionary(); - - public DrawCommands() - { - _log = LogManager.GetCurrentClassLogger(); - } - private const string cardsPath = "data/images/cards"; - private Logger _log { get; } [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] @@ -42,7 +35,7 @@ namespace NadekoBot.Modules.Gambling { if (cards.CardPool.Count == 0 && i != 0) { - try { await Context.Channel.SendErrorAsync("No more cards in a deck.").ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } + try { await Context.Channel.SendErrorAsync("No more cards in a deck.").ConfigureAwait(false); } catch { } break; } var currentCard = cards.DrawACard(); diff --git a/src/NadekoBot/Modules/Games/Commands/HangmanCommands.cs b/src/NadekoBot/Modules/Games/Commands/HangmanCommands.cs index db631ec5..eba11193 100644 --- a/src/NadekoBot/Modules/Games/Commands/HangmanCommands.cs +++ b/src/NadekoBot/Modules/Games/Commands/HangmanCommands.cs @@ -18,15 +18,11 @@ namespace NadekoBot.Modules.Games //channelId, game public static ConcurrentDictionary HangmanGames { get; } = new ConcurrentDictionary(); + private static string typesStr { get; } = ""; static HangmanCommands() { _log = LogManager.GetCurrentClassLogger(); - } - - string typesStr { get; } = ""; - public HangmanCommands() - { typesStr = $"`List of \"{NadekoBot.ModulePrefixes[typeof(Games).Name]}hangman\" term types:`\n" + String.Join(", ", Enum.GetNames(typeof(HangmanTermPool.HangmanTermType))); } diff --git a/src/NadekoBot/Modules/Games/Commands/SpeedTypingCommands.cs b/src/NadekoBot/Modules/Games/Commands/SpeedTypingCommands.cs index 6ca731c7..bb69063f 100644 --- a/src/NadekoBot/Modules/Games/Commands/SpeedTypingCommands.cs +++ b/src/NadekoBot/Modules/Games/Commands/SpeedTypingCommands.cs @@ -148,7 +148,6 @@ namespace NadekoBot.Modules.Games [Group] public class SpeedTypingCommands : ModuleBase { - public static List TypingArticles { get; } = new List(); const string typingArticlesPath = "data/typing_articles.json"; @@ -157,12 +156,7 @@ namespace NadekoBot.Modules.Games { try { TypingArticles = JsonConvert.DeserializeObject>(File.ReadAllText(typingArticlesPath)); } catch { } } - public static ConcurrentDictionary RunningContests; - - public SpeedTypingCommands() - { - RunningContests = new ConcurrentDictionary(); - } + public static ConcurrentDictionary RunningContests = new ConcurrentDictionary(); [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] diff --git a/src/NadekoBot/Modules/Music/Music.cs b/src/NadekoBot/Modules/Music/Music.cs index a6dbc9ae..89ca9451 100644 --- a/src/NadekoBot/Modules/Music/Music.cs +++ b/src/NadekoBot/Modules/Music/Music.cs @@ -27,7 +27,7 @@ namespace NadekoBot.Modules.Music public const string MusicDataPath = "data/musicdata"; - public Music() : base() + static Music() { //it can fail if its currenctly opened or doesn't exist. Either way i don't care try { Directory.Delete(MusicDataPath, true); } catch { } @@ -37,7 +37,7 @@ namespace NadekoBot.Modules.Music Directory.CreateDirectory(MusicDataPath); } - private async void Client_UserVoiceStateUpdated(SocketUser iusr, SocketVoiceState oldState, SocketVoiceState newState) + private static async void Client_UserVoiceStateUpdated(SocketUser iusr, SocketVoiceState oldState, SocketVoiceState newState) { var usr = iusr as SocketGuildUser; if (usr == null || @@ -60,10 +60,7 @@ namespace NadekoBot.Modules.Music player.TogglePause(); } } - catch (Exception ex) - { - _log.Warn(ex); - } + catch { } } [NadekoCommand, Usage, Description, Aliases] diff --git a/src/NadekoBot/Modules/NSFW/NSFW.cs b/src/NadekoBot/Modules/NSFW/NSFW.cs index 860b4828..641c3514 100644 --- a/src/NadekoBot/Modules/NSFW/NSFW.cs +++ b/src/NadekoBot/Modules/NSFW/NSFW.cs @@ -22,10 +22,6 @@ namespace NadekoBot.Modules.NSFW //ulong/cancel private static ConcurrentDictionary AutoHentaiTimers { get; } = new ConcurrentDictionary(); - public NSFW() : base() - { - } - [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] public async Task Hentai([Remainder] string tag = null) diff --git a/src/NadekoBot/Modules/Permissions/Permissions.cs b/src/NadekoBot/Modules/Permissions/Permissions.cs index 505b55e1..d2b282aa 100644 --- a/src/NadekoBot/Modules/Permissions/Permissions.cs +++ b/src/NadekoBot/Modules/Permissions/Permissions.cs @@ -49,10 +49,6 @@ namespace NadekoBot.Modules.Permissions _log.Debug($"Loaded in {sw.Elapsed.TotalSeconds:F2}s"); } - public Permissions() : base() - { - } - [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] public async Task Verbose(PermissionAction action) diff --git a/src/NadekoBot/Modules/Pokemon/Pokemon.cs b/src/NadekoBot/Modules/Pokemon/Pokemon.cs index 51a4f1af..7f51deb0 100644 --- a/src/NadekoBot/Modules/Pokemon/Pokemon.cs +++ b/src/NadekoBot/Modules/Pokemon/Pokemon.cs @@ -24,18 +24,18 @@ namespace NadekoBot.Modules.Pokemon public const string PokemonTypesFile = "data/pokemon_types.json"; - private Logger _pokelog { get; } + private static new Logger _log { get; } - public Pokemon() : base() + static Pokemon() { - _pokelog = LogManager.GetCurrentClassLogger(); + _log = LogManager.GetCurrentClassLogger(); if (File.Exists(PokemonTypesFile)) { PokemonTypes = JsonConvert.DeserializeObject>(File.ReadAllText(PokemonTypesFile)); } else { - _pokelog.Warn(PokemonTypesFile + " is missing. Pokemon types not loaded."); + _log.Warn(PokemonTypesFile + " is missing. Pokemon types not loaded."); } } diff --git a/src/NadekoBot/Modules/Searches/Commands/PlaceCommands.cs b/src/NadekoBot/Modules/Searches/Commands/PlaceCommands.cs index df53ae32..af8a1fb3 100644 --- a/src/NadekoBot/Modules/Searches/Commands/PlaceCommands.cs +++ b/src/NadekoBot/Modules/Searches/Commands/PlaceCommands.cs @@ -12,11 +12,7 @@ namespace NadekoBot.Modules.Searches [Group] public class PlaceCommands : ModuleBase { - string typesStr { get; } = ""; - public PlaceCommands() - { - typesStr = $"`List of \"{NadekoBot.ModulePrefixes[typeof(Searches).Name]}place\" tags:`\n" + String.Join(", ", Enum.GetNames(typeof(PlaceType))); - } + private static string typesStr { get; } = $"`List of \"{NadekoBot.ModulePrefixes[typeof(Searches).Name]}place\" tags:`\n" + String.Join(", ", Enum.GetNames(typeof(PlaceType))); public enum PlaceType { diff --git a/src/NadekoBot/Modules/Utility/Commands/Remind.cs b/src/NadekoBot/Modules/Utility/Commands/Remind.cs index 92bbb3fb..6cb3965f 100644 --- a/src/NadekoBot/Modules/Utility/Commands/Remind.cs +++ b/src/NadekoBot/Modules/Utility/Commands/Remind.cs @@ -22,17 +22,17 @@ namespace NadekoBot.Modules.Utility Regex regex = new Regex(@"^(?:(?\d)mo)?(?:(?\d)w)?(?:(?\d{1,2})d)?(?:(?\d{1,2})h)?(?:(?\d{1,2})m)?$", RegexOptions.Compiled | RegexOptions.Multiline); - private string RemindMessageFormat { get; } + private static string RemindMessageFormat { get; } - IDictionary> replacements = new Dictionary> + private static IDictionary> replacements = new Dictionary> { { "%message%" , (r) => r.Message }, { "%user%", (r) => $"<@!{r.UserId}>" }, { "%target%", (r) => r.IsPrivate ? "Direct Message" : $"<#{r.ChannelId}>"} }; - private Logger _log { get; } + private static Logger _log { get; } - public RemindCommands() + static RemindCommands() { _log = LogManager.GetCurrentClassLogger(); List reminders; @@ -49,7 +49,7 @@ namespace NadekoBot.Modules.Utility } } - private async Task StartReminder(Reminder r) + private static async Task StartReminder(Reminder r) { var now = DateTime.Now; var twoMins = new TimeSpan(0, 2, 0); diff --git a/src/NadekoBot/Modules/Utility/Commands/UnitConversion.cs b/src/NadekoBot/Modules/Utility/Commands/UnitConversion.cs index 97beb8c3..41ca8133 100644 --- a/src/NadekoBot/Modules/Utility/Commands/UnitConversion.cs +++ b/src/NadekoBot/Modules/Utility/Commands/UnitConversion.cs @@ -54,15 +54,11 @@ namespace NadekoBot.Modules.Utility { _log.Warn("Could not load units: " + e.Message); } - } - public UnitConverterCommands() - { _timer = new Timer(async (obj) => await UpdateCurrency(), null, (int)updateInterval.TotalMilliseconds, (int)updateInterval.TotalMilliseconds); - } - public async Task UpdateCurrency() + public static async Task UpdateCurrency() { try { diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index d6dadc45..d98d13d0 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -16,11 +16,6 @@ namespace NadekoBot.Modules.Utility [NadekoModule("Utility", ".")] public partial class Utility : DiscordModule { - public Utility() : base() - { - - } - [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] public async Task TogetherTube()