mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[cm] ability to ban user for an arbitrary period
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user