From 3cf8d100de5fd9e7489504cb002d2cb2dcf22793 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Tue, 27 Dec 2016 14:21:53 +0100 Subject: [PATCH] .repeat reverted to fix a bug --- .../Modules/Administration/Commands/MessageRepeater.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs b/src/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs index 2063a381..1e051bcd 100644 --- a/src/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs +++ b/src/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs @@ -53,13 +53,13 @@ namespace NadekoBot.Modules.Administration var toSend = "🔄 " + Repeater.Message; await Task.Delay(Repeater.Interval, token).ConfigureAwait(false); - var lastMsgInChannel = (await Channel.GetMessagesAsync(1)).FirstOrDefault(); - if (lastMsgInChannel.Id == oldMsg.Id) //don't send if it's the same message in the channel - continue; + //var lastMsgInChannel = (await Channel.GetMessagesAsync(2)).FirstOrDefault(); + // if (lastMsgInChannel.Id == oldMsg?.Id) //don't send if it's the same message in the channel + // continue; if (oldMsg != null) try { await oldMsg.DeleteAsync(); } catch { } - try { oldMsg = await Channel.SendMessageAsync(toSend).ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); try { source.Cancel(); } catch { } } + try { oldMsg = await Channel.SendMessageAsync(toSend).ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); } } } catch (OperationCanceledException) { }