28 lines
544 B
C#
28 lines
544 B
C#
|
using System;
|
|||
|
|
|||
|
namespace DeukBot4.MessageHandlers.CommandHandler.RequestStructure
|
|||
|
{
|
|||
|
public class RequestParameter
|
|||
|
{
|
|||
|
private readonly string _value;
|
|||
|
|
|||
|
public RequestParameter(string value)
|
|||
|
{
|
|||
|
_value = value;
|
|||
|
}
|
|||
|
|
|||
|
public int AsInt()
|
|||
|
{
|
|||
|
if (int.TryParse(_value, out var i))
|
|||
|
{
|
|||
|
return i;
|
|||
|
}
|
|||
|
throw new ArgumentException();
|
|||
|
}
|
|||
|
|
|||
|
public string AsString()
|
|||
|
{
|
|||
|
return _value;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|