internal void SetCommand(int userId, int chatId, string command) { var commandState = GetCommandState(userId, chatId); if (commandState == null) { commandState = new CommandState(); } if (string.IsNullOrEmpty(commandState.commandText) || !commandState.commandText.Equals(command, StringComparison.InvariantCultureIgnoreCase)) { commandState.commandText = command; commandState.chatId = chatId; commandState.userId = userId; commandState.Parameters.Clear(); } Store(commandState); }
private void Store(CommandState commandState) { GetOdb().Store(commandState); }
internal void SetParameter(int userId, int chatId, object parameter) { CommandState commandState = GetCommandState(userId, chatId); commandState?.Parameters.Add(parameter); }