diff --git a/NadekoBot.Core/Modules/Games/PlantAndPickCommands.cs b/NadekoBot.Core/Modules/Games/PlantAndPickCommands.cs index 179e9c91..1cb1e388 100644 --- a/NadekoBot.Core/Modules/Games/PlantAndPickCommands.cs +++ b/NadekoBot.Core/Modules/Games/PlantAndPickCommands.cs @@ -24,6 +24,7 @@ namespace NadekoBot.Modules.Games [Group] public class PlantPickCommands : NadekoSubmodule { + //todo rewrite private readonly CurrencyService _cs; private readonly IBotConfigProvider _bc; private readonly DbService _db; @@ -42,10 +43,10 @@ namespace NadekoBot.Modules.Games { var channel = (ITextChannel)Context.Channel; + ///waaaaaat if (!(await channel.Guild.GetCurrentUserAsync()).GetPermissions(channel).ManageMessages) return; - try { await Context.Message.DeleteAsync().ConfigureAwait(false); } catch { } if (!_service.PlantedFlowers.TryRemove(channel.Id, out List msgs)) return; @@ -72,23 +73,27 @@ namespace NadekoBot.Modules.Games return; } - var imgData = _service.GetRandomCurrencyImage(); - - var msgToSend = GetText("planted", - Format.Bold(Context.User.ToString()), - amount + _bc.BotConfig.CurrencySign, - Prefix); - - if (amount > 1) - msgToSend += " " + GetText("pick_pl", Prefix); - else - msgToSend += " " + GetText("pick_sn", Prefix); - - IUserMessage msg; - using (var toSend = imgData.Data.ToStream()) + IUserMessage msg = null; + try { - msg = await Context.Channel.SendFileAsync(toSend, imgData.Name, msgToSend).ConfigureAwait(false); + var imgData = _service.GetRandomCurrencyImage(); + + var msgToSend = GetText("planted", + Format.Bold(Context.User.ToString()), + amount + _bc.BotConfig.CurrencySign, + Prefix); + + if (amount > 1) + msgToSend += " " + GetText("pick_pl", Prefix); + else + msgToSend += " " + GetText("pick_sn", Prefix); + + using (var toSend = imgData.Data.ToStream()) + { + msg = await Context.Channel.SendFileAsync(toSend, imgData.Name, msgToSend).ConfigureAwait(false); + } } + catch { } var msgs = new IUserMessage[amount]; msgs[0] = msg; diff --git a/NadekoBot.Core/Services/Database/Models/GuildConfig.cs b/NadekoBot.Core/Services/Database/Models/GuildConfig.cs index 3cda8b09..2c855e20 100644 --- a/NadekoBot.Core/Services/Database/Models/GuildConfig.cs +++ b/NadekoBot.Core/Services/Database/Models/GuildConfig.cs @@ -55,8 +55,8 @@ namespace NadekoBot.Core.Services.Database.Models public bool FilterInvites { get; set; } public HashSet FilterInvitesChannelIds { get; set; } = new HashSet(); - public bool FilterLinks { get; set; } - public HashSet FilterLinksChannels { get; set; } = new HashSet(); + //public bool FilterLinks { get; set; } + //public HashSet FilterLinksChannels { get; set; } = new HashSet(); public bool FilterWords { get; set; } public HashSet FilteredWords { get; set; } = new HashSet(); diff --git a/NadekoBot.Core/Services/NadekoBot.cs b/NadekoBot.Core/Services/NadekoBot.cs index d180f0dd..6e974535 100644 --- a/NadekoBot.Core/Services/NadekoBot.cs +++ b/NadekoBot.Core/Services/NadekoBot.cs @@ -185,7 +185,7 @@ namespace NadekoBot throw; } toReturn.Add(x); - _log.Info("Loaded {0} typereader.", x.GetType().Name); + //_log.Info("Loaded {0} typereader.", x.GetType().Name); } return toReturn; @@ -250,7 +250,15 @@ namespace NadekoBot await LoginAsync(Credentials.Token).ConfigureAwait(false); _log.Info($"Shard {Client.ShardId} loading services..."); - AddServices(); + try + { + AddServices(); + } + catch (Exception ex) + { + _log.Error(ex); + throw; + } sw.Stop(); _log.Info($"Shard {Client.ShardId} connected in {sw.Elapsed.TotalSeconds:F2}s");