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
bb66fcfe
Unverified
Commit
bb66fcfe
authored
Dec 27, 2016
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add getBotName method to entity, to facilitate retrieval.
parent
5fab2c79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
Entity.php
src/Entities/Entity.php
+2
-1
Message.php
src/Entities/Message.php
+1
-1
No files found.
src/Entities/Entity.php
View file @
bb66fcfe
...
...
@@ -21,7 +21,8 @@ use ReflectionObject;
*
* @link https://core.telegram.org/bots/api#available-types
*
* @method array getRawData() Get the raw data passed to this entity
* @method array getRawData() Get the raw data passed to this entity
* @method string getBotName() Return the bot name passed to this entity
*/
abstract
class
Entity
{
...
...
src/Entities/Message.php
View file @
bb66fcfe
...
...
@@ -182,7 +182,7 @@ class Message extends Entity
$split_cmd
=
explode
(
'@'
,
$cmd
);
if
(
isset
(
$split_cmd
[
1
]))
{
//command is followed by name check if is addressed to me
if
(
strtolower
(
$split_cmd
[
1
])
===
strtolower
(
$this
->
bot_name
))
{
if
(
strtolower
(
$split_cmd
[
1
])
===
strtolower
(
$this
->
getBotName
()
))
{
return
$split_cmd
[
0
];
}
}
else
{
...
...
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