File tree Expand file tree Collapse file tree 6 files changed +33
-35
lines changed Expand file tree Collapse file tree 6 files changed +33
-35
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " lbiltech/telegram-git-notifier-app" ,
3
- "description" : " Send notification from Gitlab and Github events to Telegram" ,
3
+ "description" : " The PHP app to send notification from Gitlab and Github events to Telegram" ,
4
4
"keywords" : [
5
5
" lbiltech" ,
6
6
" telegram-bot" ,
22
22
"require" : {
23
23
"php" : " ^8.0" ,
24
24
"ext-json" : " *" ,
25
- "lbiltech/telegram-git-notifier" : " dev-main "
25
+ "lbiltech/telegram-git-notifier" : " ^1.2.0 "
26
26
},
27
27
"autoload" : {
28
28
"psr-4" : {
File renamed without changes.
Original file line number Diff line number Diff line change 5
5
use LbilTech \TelegramGitNotifier \Bot ;
6
6
use LbilTech \TelegramGitNotifier \Constants \SettingConstant ;
7
7
use LbilTech \TelegramGitNotifier \Exceptions \MessageIsEmptyException ;
8
+ use LbilTech \TelegramGitNotifierApp \Traits \Markup ;
8
9
9
10
class CallbackService
10
11
{
12
+ use Markup;
13
+
11
14
private Bot $ bot ;
12
15
13
16
public function __construct (Bot $ bot )
@@ -42,7 +45,7 @@ public function answerBackButton(string $callback): void
42
45
break ;
43
46
case 'menu ' :
44
47
$ view = view ('tools.menu ' );
45
- $ markup = $ this ->menuMarkup ();
48
+ $ markup = $ this ->menuMarkup ($ this -> bot -> telegram );
46
49
break ;
47
50
default :
48
51
$ this ->bot ->answerCallbackQuery ('Unknown callback ' );
@@ -53,18 +56,4 @@ public function answerBackButton(string $callback): void
53
56
'reply_markup ' => $ markup ,
54
57
]);
55
58
}
56
-
57
- /**
58
- * @return array[]
59
- */
60
- public function menuMarkup (): array
61
- {
62
- return [
63
- [
64
- $ this ->bot ->telegram ->buildInlineKeyBoardButton ('🗨 Discussion ' , config ('telegram-git-notifier.author.discussion ' ))
65
- ], [
66
- $ this ->bot ->telegram ->buildInlineKeyBoardButton ('💠 Source Code ' , config ('telegram-git-notifier.author.source_code ' ))
67
- ]
68
- ];
69
- }
70
59
}
Original file line number Diff line number Diff line change 4
4
5
5
use LbilTech \TelegramGitNotifier \Bot ;
6
6
use LbilTech \TelegramGitNotifier \Exceptions \EntryNotFoundException ;
7
- use Telegram ;
7
+ use LbilTech \ TelegramGitNotifierApp \ Traits \ Markup ;
8
8
9
9
class CommandService
10
10
{
11
+ use Markup;
12
+
11
13
public const MENU_COMMANDS
12
14
= [
13
15
[
@@ -34,22 +36,6 @@ class CommandService
34
36
],
35
37
];
36
38
37
- /**
38
- * Generate menu markup
39
- *
40
- * @return array[]
41
- */
42
- public function menuMarkup (Telegram $ telegram ): array
43
- {
44
- return [
45
- [
46
- $ telegram ->buildInlineKeyBoardButton ("🗨 Discussion " , config ('telegram-git-notifier.author.discussion ' ))
47
- ], [
48
- $ telegram ->buildInlineKeyBoardButton ("💠 Source Code " , config ('telegram-git-notifier.author.source_code ' ))
49
- ]
50
- ];
51
- }
52
-
53
39
/**
54
40
* @param Bot $bot
55
41
*
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace LbilTech \TelegramGitNotifierApp \Traits ;
4
+
5
+ use Telegram ;
6
+
7
+ trait Markup
8
+ {
9
+ /**
10
+ * Generate menu markup
11
+ *
12
+ * @return array[]
13
+ */
14
+ public function menuMarkup (Telegram $ telegram ): array
15
+ {
16
+ return [
17
+ [
18
+ $ telegram ->buildInlineKeyBoardButton ('🗨 Discussion ' , config ('telegram-git-notifier.author.discussion ' ))
19
+ ], [
20
+ $ telegram ->buildInlineKeyBoardButton ('💠 Source Code ' , config ('telegram-git-notifier.author.source_code ' ))
21
+ ]
22
+ ];
23
+ }
24
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments