.repeat deletes previous repeat message, to prevent spam (SenaRawr's suggestion)

This commit is contained in:
Master Kwoth 2016-04-01 22:15:18 +02:00
parent 7863c48901
commit 52923e2680

View File

@ -20,6 +20,7 @@ namespace NadekoBot.Modules.Administration.Commands
public ulong RepeatingServerId { get; set; } public ulong RepeatingServerId { get; set; }
public ulong RepeatingChannelId { get; set; } public ulong RepeatingChannelId { get; set; }
public Message lastMessage { get; set; } = null;
public string RepeatingMessage { get; set; } public string RepeatingMessage { get; set; }
public int Interval { get; set; } public int Interval { get; set; }
@ -34,7 +35,13 @@ namespace NadekoBot.Modules.Administration.Commands
{ {
try try
{ {
await ch.SendMessage(msg); if (lastMessage != null)
await lastMessage.Delete();
}
catch { }
try
{
lastMessage = await ch.SendMessage(msg);
} }
catch { } catch { }
} }