mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
31 lines
622 B
C#
31 lines
622 B
C#
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;
|
|
}
|
|
}
|
|
} |