If timespan of muting is lower or equal to 0 default to the minimum
This commit is contained in:
parent
c3b23d150f
commit
a98f34527f
|
@ -179,6 +179,8 @@ namespace DeukBot4.MessageHandlers.CommandHandler
|
|||
}
|
||||
}
|
||||
|
||||
if (span.Seconds <= 0)
|
||||
span = TimeSpan.FromMinutes(5);
|
||||
await Task.Delay(span);
|
||||
await user.RemoveRoleAsync(silencedRole);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using DeukBot4.Utilities;
|
||||
using Discord.WebSocket;
|
||||
|
@ -38,16 +39,14 @@ namespace DeukBot4.MessageHandlers
|
|||
|
||||
private static async Task DeltaHandler(SocketMessage message)
|
||||
{
|
||||
var lower = message.Content.ToLowerInvariant().RemoveSpecialCharacters().Split(' ');
|
||||
foreach (var s in lower)
|
||||
{
|
||||
var diff = Lehvenstein.LevenshteinDistance(s, "delta");
|
||||
if (diff <= 1)
|
||||
var lowerCasedContent = message.Content.RemoveSpecialCharacters();
|
||||
if (lowerCasedContent.Contains("origin"))
|
||||
return;
|
||||
|
||||
var lowerSplit = lowerCasedContent.Split(' ');
|
||||
if (lowerSplit.Select(s => Lehvenstein.LevenshteinDistance(s, "delta")).Any(diff => diff <= 1))
|
||||
{
|
||||
await message.Channel.SendMessageAsync("uhh excuse me it's called Origin and it's an art");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue