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
1053c036
Commit
1053c036
authored
Jul 19, 2015
by
MBoretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some methods in Message Entity
parent
dc15c4c1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
Message.php
src/Entities/Message.php
+50
-0
Telegram.php
src/Telegram.php
+1
-1
No files found.
src/Entities/Message.php
View file @
1053c036
...
...
@@ -100,6 +100,26 @@ class Message extends Entity
if
(
!
empty
(
$this
->
reply_to_message
))
{
$this
->
reply_to_message
=
new
Message
(
$this
->
reply_to_message
);
}
$this
->
new_chat_participant
=
isset
(
$data
[
'new_chat_participant'
])
?
$data
[
'new_chat_participant'
]
:
null
;
if
(
!
empty
(
$this
->
new_chat_participant
))
{
$this
->
new_chat_participant
=
new
User
(
$this
->
new_chat_participant
);
}
$this
->
left_chat_participant
=
isset
(
$data
[
'left_chat_participant'
])
?
$data
[
'left_chat_participant'
]
:
null
;
if
(
!
empty
(
$this
->
left_chat_participant
))
{
$this
->
left_chat_participant
=
new
User
(
$this
->
left_chat_participant
);
}
$this
->
new_chat_title
=
isset
(
$data
[
'new_chat_title'
])
?
$data
[
'new_chat_title'
]
:
null
;
$this
->
delete_chat_photo
=
isset
(
$data
[
'delete_chat_photo'
])
?
$data
[
'delete_chat_photo'
]
:
null
;
$this
->
group_chat_created
=
isset
(
$data
[
'group_chat_created'
])
?
$data
[
'group_chat_created'
]
:
null
;
}
//return the entire command like /echo or /echo@bot1 if specified
...
...
@@ -178,6 +198,36 @@ class Message extends Entity
return
$this
->
reply_to_message
;
}
public
function
getNewChatParticipant
()
{
return
$this
->
new_chat_participant
;
}
public
function
getLeftChatParticipant
()
{
return
$this
->
left_chat_participant
;
}
public
function
getNewChatTitle
()
{
return
$this
->
new_chat_title
;
}
public
function
getDeleteChatPhoto
()
{
return
$this
->
delete_chat_photo
;
}
public
function
getGroupChatCreated
()
{
return
$this
->
group_chat_created
;
}
public
function
getText
(
$without_cmd
=
false
)
{
$text
=
$this
->
text
;
...
...
src/Telegram.php
View file @
1053c036
...
...
@@ -284,7 +284,7 @@ class Telegram
*
* @return mixed
*/
p
rotected
function
executeCommand
(
$command
,
Update
$update
)
p
ublic
function
executeCommand
(
$command
,
Update
$update
)
{
$class
=
$this
->
getCommandClass
(
$command
,
$update
);
if
(
empty
(
$class
))
{
...
...
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