- added a custom exception for maximum length messages, saves to time to sent to API

- added a constants file, for have constants to work with
- catching maximum message length
This commit is contained in:
FlorianDahn
2019-09-17 16:43:02 +02:00
parent ae0fa3b0e3
commit 703c99eb8d
3 changed files with 68 additions and 8 deletions
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TelegramBotBase.Exceptions
{
public class MaxLengthException : Exception
{
public MaxLengthException(int length) : base($"Your messages with a length of {length} is too long for telegram. Actually is {Constants.Telegram.MaxMessageLength} characters allowed. Please split it.")
{
}
}
}