Skip to content

Commit fdb93a0

Browse files
committed
fix boolean and add slack message
1 parent 7bd259e commit fdb93a0

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

app/Jobs/SlackCommands.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,24 +295,28 @@ public function handle(): void
295295

296296
break;
297297
case '!sleep':
298-
// pause all offers
299-
$adminDashboardController = new \App\Http\Controllers\AdminDashboardController();
300-
$adminDashboardController->pauseAll();
301298
// turn off all auto settings
302299
$adminDashboard->autoAccept = false;
303300
$adminDashboard->autoCreate = false;
304-
$adminDashboard->autoSchedule = false;
301+
$adminDashboard->scheduler = false;
305302
$adminDashboard->save();
303+
// pause all offers
304+
$adminDashboardController = new \App\Http\Controllers\AdminDashboardController();
305+
$adminDashboardController->pauseAll();
306+
307+
$slackService->sendMessage('All auto settings turned off and all offers paused', $channelId);
306308
break;
307309
case '!wake':
308-
// unpause all offers
309-
$adminDashboardController = new \App\Http\Controllers\AdminDashboardController();
310-
$adminDashboardController->unpauseAll();
311310
// turn on all auto settings
312311
$adminDashboard->autoAccept = true;
313312
$adminDashboard->autoCreate = true;
314-
$adminDashboard->autoSchedule = true;
313+
$adminDashboard->scheduler = true;
315314
$adminDashboard->save();
315+
// unpause all offers
316+
$adminDashboardController = new \App\Http\Controllers\AdminDashboardController();
317+
$adminDashboardController->unpauseAll();
318+
319+
$slackService->sendMessage('Auto accept, auto create, and scheduler turned on and all offers unpaused', $channelId);
316320
break;
317321
default:
318322
$slackService->sendMessage('Command not recognized', $channelId);

0 commit comments

Comments
 (0)