示例#1
0
        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);
        }
示例#2
0
 private void Store(CommandState commandState)
 {
     GetOdb().Store(commandState);
 }
示例#3
0
        internal void SetParameter(int userId, int chatId, object parameter)
        {
            CommandState commandState = GetCommandState(userId, chatId);

            commandState?.Parameters.Add(parameter);
        }