[cm] ability to ban user for an arbitrary period

This commit is contained in:
West14
2022-04-23 21:03:33 +03:00
parent 634695d0d8
commit 5b77ef2b85
6 changed files with 66 additions and 24 deletions
@@ -0,0 +1,31 @@
using BotFramework;
using static System.UInt32;
namespace West.TelegramBot.ChatManagement.ParamParser;
public class BanLength
{
public class Param
{
public uint DayCount;
}
public class Parser : IParameterParser<Param>
{
public Param DefaultInstance()
{
return new Param();
}
public bool TryGetValue(string text, out Param result)
{
result = DefaultInstance();
if (!TryParse(text, out result.DayCount))
{
result.DayCount = 7;
}
return true;
}
}
}