Skip to content

Commit

Permalink
fix: generate callback action
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Oct 19, 2023
1 parent 4e1bcb6 commit cc0526f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 47 deletions.
4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ for file in "${json_files[@]}"; do
fi
done

chmod -R 777 storage/json/*.json
if [[ "$(uname -s -r)" == *"Linux"* && "$(cat /etc/os-release)" == *"Ubuntu"* ]]; then
chmod 777 storage/json/tgn/*.json
fi
14 changes: 14 additions & 0 deletions src/Http/Actions/CallbackAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@

namespace LbilTech\TelegramGitNotifierApp\Http\Actions;

use LbilTech\TelegramGitNotifier\Bot;
use LbilTech\TelegramGitNotifierApp\Services\CallbackService;

class CallbackAction
{
protected Bot $bot;

protected CallbackService $callbackService;

public function __construct(
Bot $bot,
) {
$this->bot = $bot;
$this->callbackService = new CallbackService();
}

public function __invoke()
{
}
Expand Down
12 changes: 6 additions & 6 deletions src/Http/Actions/IndexAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public function __construct()
*/
public function __invoke(): void
{
// if ($this->bot->isCallback()) {
// $callbackAction = new CallbackAction($this->appService, $this->settingService);
// $callbackAction();
// return;
// }
//
if ($this->bot->isCallback()) {
$callbackAction = new CallbackAction($this->bot);
$callbackAction();
return;
}

if ($this->bot->isMessage()) {
$commandAction = new CommandAction($this->bot);
$commandAction();
Expand Down
17 changes: 0 additions & 17 deletions src/Services/AppService.php

This file was deleted.

7 changes: 7 additions & 0 deletions src/Services/CallbackService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace LbilTech\TelegramGitNotifierApp\Services;

class CallbackService
{
}
23 changes: 0 additions & 23 deletions src/Services/SettingService.php

This file was deleted.

0 comments on commit cc0526f

Please sign in to comment.