Beispiel #1
0
 protected virtual void Process(MessageInfo message, CommandInfo command)
 {
     if (command.Parameters.Any())
     {
         GetFirstParameter(message, command);
     }
     else
     {
         Data.DeleteCommandState(message.From.Id, message.Chat.Id);
         RunRequest(message, command);
     }
 }
Beispiel #2
0
 protected virtual void RunRequest(MessageInfo message, CommandInfo command)
 {
     Client.SendMessage(message.Chat.Id, command.StaticAcceptMessage);
 }
Beispiel #3
0
 protected virtual void GetFirstParameter(MessageInfo message, CommandInfo command)
 {
     var parameter = command.Parameters.First();
     Data.SetCommand(message.From.Id, message.Chat.Id, command.Text);
     Client.SendMessage(message.Chat.Id, parameter.StaticPrompt);
 }
 public CommandEventArgs(MessageInfo message, CommandInfo command)
 {
     Message = message;
     Command = command;
 }