projects
/
SonOfLokstallBot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5698a27
)
Fix bug where tasks weren't detected as all done after completing the last one
author
Cameron Ball
<cameron@cameron1729.xyz>
Sat, 5 Jan 2019 19:58:30 +0000
(
03:58
+0800)
committer
Cameron Ball
<cameron@cameron1729.xyz>
Sun, 6 Jan 2019 18:34:13 +0000
(
02:34
+0800)
src/purjolok.php
patch
|
blob
|
history
diff --git
a/src/purjolok.php
b/src/purjolok.php
index
ab224a3
..
9f4cacd
100644
(file)
--- a/
src/purjolok.php
+++ b/
src/purjolok.php
@@
-75,7
+75,7
@@
if ($between = between(reveal($message ?? ''), '[taskid]')) {
'sticker' => 'CAADBQADOwAD__7RB2i3XcCiO8HuAg'
]);
'sticker' => 'CAADBQADOwAD__7RB2i3XcCiO8HuAg'
]);
- if (!array_diff($tasksForTheWeek,
$completedTasks
)) {
+ if (!array_diff($tasksForTheWeek,
array_merge($completedTasks, [$between])
)) {
getTelegram()->sendMessage([
'chat_id' => $chatid,
'text' => getString('heyTasksAllCompleted')
getTelegram()->sendMessage([
'chat_id' => $chatid,
'text' => getString('heyTasksAllCompleted')
@@
-300,8
+300,6
@@
getTelegram()->addCommand(
$completedTasksFile = getFilePathForWeek($yearForThisWeek, $monthForThisWeek, $weekNum);
$completedTasks = file_exists($completedTasksFile) ? lines(trim(file_get_contents($completedTasksFile))) : [];
$completedTasksFile = getFilePathForWeek($yearForThisWeek, $monthForThisWeek, $weekNum);
$completedTasks = file_exists($completedTasksFile) ? lines(trim(file_get_contents($completedTasksFile))) : [];
-
-
if (!array_diff($tasksForTheWeek, $completedTasks)) {
$this->replyWithMessage([
'text' => getString('tasksAllCompleted')
if (!array_diff($tasksForTheWeek, $completedTasks)) {
$this->replyWithMessage([
'text' => getString('tasksAllCompleted')