Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
154e33ce
Commit
154e33ce
authored
Aug 08, 2015
by
MBoretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Help Command Error and new commads error
parent
8d5d3435
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
14 deletions
+21
-14
HelpCommand.php
src/Commands/HelpCommand.php
+10
-7
LeftchatparticipantCommand.php
src/Commands/LeftchatparticipantCommand.php
+1
-1
NewchatparticipantCommand.php
src/Commands/NewchatparticipantCommand.php
+1
-1
Telegram.php
src/Telegram.php
+9
-5
No files found.
src/Commands/HelpCommand.php
View file @
154e33ce
...
...
@@ -33,18 +33,21 @@ class HelpCommand extends Command
$text
=
$message
->
getText
(
true
);
$commands
=
$this
->
telegram
->
getCommandsList
();
if
(
empty
(
$text
))
{
$msg
=
'GeoBot v. '
.
$this
->
telegram
->
getVersion
()
.
"
\n\n
"
;
$msg
.=
'Commands List:'
.
"
\n
"
;
foreach
(
$commands
as
$command
)
{
if
(
!
$command
->
isEnabled
())
{
continue
;
}
if
(
!
$command
->
isPublic
())
{
continue
;
}
if
(
is_object
(
$command
))
{
if
(
!
$command
->
isEnabled
())
{
continue
;
}
if
(
!
$command
->
isPublic
())
{
continue
;
}
$msg
.=
'/'
.
$command
->
getName
()
.
' - '
.
$command
->
getDescription
()
.
"
\n
"
;
$msg
.=
'/'
.
$command
->
getName
()
.
' - '
.
$command
->
getDescription
()
.
"
\n
"
;
}
}
$msg
.=
"
\n
"
.
'For exact command help type: /help <command>'
;
...
...
src/Commands/Left
ChatP
articipantCommand.php
→
src/Commands/Left
chatp
articipantCommand.php
View file @
154e33ce
...
...
@@ -14,7 +14,7 @@ use Longman\TelegramBot\Request;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Entities\Update
;
class
Left
ChatP
articipantCommand
extends
Command
class
Left
chatp
articipantCommand
extends
Command
{
protected
$name
=
'left_chat_participant'
;
protected
$description
=
'Left Chat Participant'
;
...
...
src/Commands/New
ChatP
articipantCommand.php
→
src/Commands/New
chatp
articipantCommand.php
View file @
154e33ce
...
...
@@ -14,7 +14,7 @@ use Longman\TelegramBot\Request;
use
Longman\TelegramBot\Command
;
use
Longman\TelegramBot\Entities\Update
;
class
New
ChatParticipantC
ommand
extends
Command
class
New
chatparticipantc
ommand
extends
Command
{
protected
$name
=
'new_chat_participant'
;
protected
$description
=
'New Chat Participant'
;
...
...
src/Telegram.php
View file @
154e33ce
...
...
@@ -189,8 +189,11 @@ class Telegram
continue
;
}
$name
=
$fileInfo
->
getFilename
();
$name
=
strtolower
(
str_replace
(
'Command.php'
,
''
,
$name
));
$commands
[
$name
]
=
$this
->
getCommandClass
(
$name
);
if
(
substr
(
$name
,
-
11
,
11
)
===
'Command.php'
)
{
$name
=
strtolower
(
str_replace
(
'Command.php'
,
''
,
$name
));
$commands
[
$name
]
=
$this
->
getCommandClass
(
$name
);
}
}
if
(
!
empty
(
$this
->
commands_dir
))
{
...
...
@@ -204,12 +207,13 @@ class Telegram
continue
;
}
$name
=
$fileInfo
->
getFilename
();
$name
=
strtolower
(
str_replace
(
'Command.php'
,
''
,
$name
));
$commands
[
$name
]
=
$this
->
getCommandClass
(
$name
);
if
(
substr
(
$name
,
-
11
,
11
)
===
'Command.php'
)
{
$name
=
strtolower
(
str_replace
(
'Command.php'
,
''
,
$name
));
$commands
[
$name
]
=
$this
->
getCommandClass
(
$name
);
}
}
}
}
return
$commands
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment