@@ -35,20 +35,22 @@ public function taskCommand(string $params) : void {
3535 if (!empty ($ params )){
3636 $ params = \explode (' ' , $ params );
3737 if (\count ($ params ) === 3 ){
38- $ this ->runTTT ($ params [2 ], $ params [0 ], $ params [1 ]);
38+ $ this ->runTTT (trim ( $ params [2 ]), trim ( $ params [0 ]), trim ( $ params [1 ]) );
3939 }
4040 else if (\count ($ params ) === 1 &&
4141 $ this ->session ->getData ('lastCategory ' ) !== false &&
4242 $ this ->session ->getData ('lastTask ' ) !== false
4343 ){
4444 $ time = str_replace ('+ ' , '' , $ params [0 ]);
45- $ this ->runTTT ($ time , $ this ->session ->getData ('lastCategory ' ), $ this ->session ->getData ('lastTask ' ));
45+ $ this ->runTTT (trim ( $ time) , $ this ->session ->getData ('lastCategory ' ), $ this ->session ->getData ('lastTask ' ));
4646 }
4747 else {
48+ $ this ->runTTT ("" , "" , "" );
4849 $ this ->answer = "Use `/task Category Task 20m` or `/task +20m` or just `/task` for Step-by-Step query " ;
4950 }
5051 }
5152 else {
53+ $ this ->runTTT ("" , "" , "" );
5254 $ this ->answer = "Recoding new Task Step-by-Step, one may also use `/task Category Task 20m` or `/task +20m`. " . PHP_EOL ;
5355 $ this ->answer .= TTTLoader::runTTTCommand (['c ' , 'c ' , 'list ' ]);
5456 $ this ->answer .= "Please choose a category: " ;
@@ -62,7 +64,7 @@ public function messageCommand(string $text) : void {
6264 switch ($ this ->session ->getTemp ('taskStep ' )){
6365 case "category " :
6466 $ this ->answer = "Please give the name of the task now: " ;
65- $ this ->session ->setData ('lastCategory ' , $ text );
67+ $ this ->session ->setData ('lastCategory ' , $ text );
6668 $ this ->session ->setTemp ('taskStep ' , 'task ' );
6769 break ;
6870 case "task " :
0 commit comments