diff --git a/src/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs b/src/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs index 501de4f2..0a5d7a20 100644 --- a/src/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs +++ b/src/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs @@ -46,12 +46,15 @@ namespace NadekoBot.Modules.Administration { source = new CancellationTokenSource(); token = source.Token; + IUserMessage oldMsg = null; try { while (!token.IsCancellationRequested) { await Task.Delay(Repeater.Interval, token).ConfigureAwait(false); - try { await Channel.SendMessageAsync("🔄 " + Repeater.Message).ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); try { source.Cancel(); } catch { } } + if (oldMsg != null) + try { await oldMsg.DeleteAsync(); } catch { } + try { oldMsg = await Channel.SendMessageAsync("🔄 " + Repeater.Message).ConfigureAwait(false); } catch (Exception ex) { _log.Warn(ex); try { source.Cancel(); } catch { } } } } catch (OperationCanceledException) { } diff --git a/src/NadekoBot/Modules/Searches/Commands/IMDB/ImdbScraper.cs b/src/NadekoBot/Modules/Searches/Commands/IMDB/ImdbScraper.cs index 32f2c34f..ce8f8a37 100644 --- a/src/NadekoBot/Modules/Searches/Commands/IMDB/ImdbScraper.cs +++ b/src/NadekoBot/Modules/Searches/Commands/IMDB/ImdbScraper.cs @@ -1,4 +1,5 @@ -using NadekoBot.Modules.Searches.Models; +using NadekoBot.Extensions; +using NadekoBot.Modules.Searches.Models; using System; using System.Collections.Generic; using System.Linq; @@ -71,7 +72,7 @@ namespace NadekoBot.Modules.Searches.IMDB mov.Status = true; mov.Title = Match(@"