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
0f9def9a
Unverified
Commit
0f9def9a
authored
Oct 11, 2017
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new getCaptionEntities method to Message entity.
parent
1d37b214
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
Message.php
src/Entities/Message.php
+16
-0
No files found.
src/Entities/Message.php
View file @
0f9def9a
...
...
@@ -66,6 +66,7 @@ class Message extends Entity
'forward_from_chat'
=>
Chat
::
class
,
'reply_to_message'
=>
ReplyToMessage
::
class
,
'entities'
=>
MessageEntity
::
class
,
'caption_entities'
=>
MessageEntity
::
class
,
'audio'
=>
Audio
::
class
,
'document'
=>
Document
::
class
,
'photo'
=>
PhotoSize
::
class
,
...
...
@@ -158,6 +159,21 @@ class Message extends Entity
return
empty
(
$pretty_array
)
?
null
:
$pretty_array
;
}
/**
* Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
*
* This method overrides the default getCaptionEntities method
* and returns a nice array of MessageEntity objects.
*
* @return null|MessageEntity[]
*/
public
function
getCaptionEntities
()
{
$pretty_array
=
$this
->
makePrettyObjectArray
(
MessageEntity
::
class
,
'caption_entities'
);
return
empty
(
$pretty_array
)
?
null
:
$pretty_array
;
}
/**
* return the entire command like /echo or /echo@bot1 if specified
*
...
...
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