Skip to content

Commit 378275a

Browse files
committed
fix: format code and update lang for bot tools
1 parent f240240 commit 378275a

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

lang/en/app.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
return [
44
'by' => 'by',
55
'unknown_callback' => 'Unknown Callback. Something went wrong!',
6+
'invalid_request' => '🤨 Invalid Request!',
67
];

lang/en/tools/menu.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@
1111
'server' => 'To get Server Information',
1212
'settings' => 'Go to settings of the bot',
1313
'back' => 'Back',
14+
15+
'discussion' => '🗨 Discussion',
16+
'source_code' => '💠 Source Code',
1417
];

src/Services/CallbackService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public function __construct(Bot $bot)
2828
* Answer the back button.
2929
*
3030
* @param string $callback
31-
*
3231
* @return void
32+
*
3333
* @throws MessageIsEmptyException
3434
* @throws BotException
3535
* @throws CallbackException
@@ -71,6 +71,7 @@ public function answerBackButton(string $callback): void
7171

7272
/**
7373
* @return void
74+
*
7475
* @throws MessageIsEmptyException
7576
* @throws InvalidViewTemplateException
7677
* @throws BotException|CallbackException

src/Services/CommandService.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public function __construct(Bot $bot)
2222
}
2323

2424
/**
25-
* @param Bot $bot
26-
*
25+
* @param Bot $bot
2726
* @return void
27+
*
2828
* @throws EntryNotFoundException
2929
*/
3030
public function sendStartMessage(Bot $bot): void
@@ -34,13 +34,14 @@ public function sendStartMessage(Bot $bot): void
3434
['first_name' => $bot->telegram->FirstName()]
3535
);
3636
$bot->sendPhoto(
37-
__DIR__ . '/../../resources/images/start.png',
37+
__DIR__.'/../../resources/images/start.png',
3838
['caption' => $reply]
3939
);
4040
}
4141

4242
/**
4343
* @return void
44+
*
4445
* @throws EntryNotFoundException
4546
* @throws MessageIsEmptyException
4647
*/
@@ -64,7 +65,7 @@ public function handle(): void
6465
case '/id':
6566
case '/usage':
6667
case '/server':
67-
$this->bot->sendMessage(view('tools.' . trim($text, '/')));
68+
$this->bot->sendMessage(view("$this->viewNamespace::tools.".trim($text, '/')));
6869

6970
break;
7071
case '/settings':
@@ -76,7 +77,7 @@ public function handle(): void
7677

7778
break;
7879
default:
79-
$this->bot->sendMessage('🤨 Invalid Request!');
80+
$this->bot->sendMessage(__('tg-notifier::app.invalid_request'));
8081
}
8182
}
8283

src/Traits/Markup.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
trait Markup
88
{
99
/**
10-
* Generate menu markup
10+
* Generate menu markup.
1111
*
1212
* @return array[]
1313
*/
1414
public function menuMarkup(Telegram $telegram): array
1515
{
1616
return [
1717
[
18-
$telegram->buildInlineKeyBoardButton('🗨 Discussion', config('telegram-git-notifier.author.discussion')),
18+
$telegram->buildInlineKeyBoardButton(__('tg-notifier::tools/menu.discussion'), config('telegram-git-notifier.author.discussion')),
1919
], [
20-
$telegram->buildInlineKeyBoardButton('💠 Source Code', config('telegram-git-notifier.author.source_code')),
20+
$telegram->buildInlineKeyBoardButton(__('tg-notifier::tools/menu.source_code'), config('telegram-git-notifier.author.source_code')),
2121
],
2222
];
2323
}

0 commit comments

Comments
 (0)