Introducing BotGroupCommand property.
This commit is contained in:
parent
7a86ecdf32
commit
801c0b77f8
@ -62,6 +62,11 @@ public class MessageResult : ResultBase
|
||||
/// </summary>
|
||||
public bool IsBotCommand => MessageText.StartsWith("/");
|
||||
|
||||
/// <summary>
|
||||
/// Is this a bot command sent from a group via @BotId ?
|
||||
/// </summary>
|
||||
public bool IsBotGroupCommand => IsBotCommand && MessageText.Contains("@");
|
||||
|
||||
/// <summary>
|
||||
/// Returns a List of all parameters which has been sent with the command itself (i.e. /start 123 456 789 =>
|
||||
/// 123,456,789)
|
||||
@ -87,12 +92,17 @@ public class MessageResult : ResultBase
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!IsBotCommand)
|
||||
if (IsBotGroupCommand)
|
||||
{
|
||||
return null;
|
||||
return MessageText.Substring(0, MessageText.LastIndexOf('@')).Split(' ')[0];
|
||||
}
|
||||
|
||||
return MessageText.Split(' ')[0];
|
||||
if (IsBotCommand)
|
||||
{
|
||||
return MessageText.Split(' ')[0];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user