array_diff cares about the order... :\
[SonOfLokstallBot.git] / src / purjolok.php
index 661e6cf..047e615 100644 (file)
@@ -71,7 +71,7 @@ if ($between = between(reveal($message ?? ''), '[taskid]')) {
         'sticker' => 'CAADBQADOgAD__7RBxFhadMBV3g5Ag'
     ]);
 
-    if (!array_diff($completedTasks, $tasksForTheWeek)) {
+    if (!array_diff($tasksForTheWeek, $completedTasks)) {
         getTelegram()->sendMessage([
             'chat_id' => $chatid,
             'text' => getString('heyTasksAllCompleted')
@@ -299,7 +299,7 @@ getTelegram()->addCommand(
 
             $completedTasks = file_exists($completedTasksFile) ? lines(trim(file_get_contents($completedTasksFile))) : [];
 
-            if (!array_diff($completedTasks, $tasksForTheWeek)) {
+            if (!array_diff($tasksForTheWeek, $completedTasks)) {
                 $this->replyWithMessage([
                     'text' => getString('tasksAllCompleted')
                 ]);