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
a7498388
Commit
a7498388
authored
Aug 24, 2015
by
MBoretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix phpcs
parent
e797f65a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
263 additions
and
278 deletions
+263
-278
Message.php
src/Entities/Message.php
+263
-278
No files found.
src/Entities/Message.php
View file @
a7498388
...
...
@@ -8,6 +8,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Longman\TelegramBot\Entities
;
use
Longman\TelegramBot\Exception\TelegramException
;
...
...
@@ -103,7 +104,7 @@ class Message extends Entity
$this
->
reply_to_message
=
isset
(
$data
[
'reply_to_message'
])
?
$data
[
'reply_to_message'
]
:
null
;
if
(
!
empty
(
$this
->
reply_to_message
))
{
$this
->
reply_to_message
=
new
Message
(
$this
->
reply_to_message
);
$this
->
reply_to_message
=
new
self
(
$this
->
reply_to_message
);
}
$this
->
new_chat_participant
=
isset
(
$data
[
'new_chat_participant'
])
?
$data
[
'new_chat_participant'
]
:
null
;
...
...
@@ -132,9 +133,6 @@ class Message extends Entity
if
(
$this
->
group_chat_created
)
{
$this
->
type
=
'group_chat_created'
;
}
}
//return the entire command like /echo or /echo@bot1 if specified
...
...
@@ -142,8 +140,8 @@ class Message extends Entity
{
if
(
substr
(
$this
->
text
,
0
,
1
)
===
'/'
)
{
return
strtok
(
$this
->
text
,
' '
);
}
else
{
return
null
;
}
else
{
return
;
}
}
...
...
@@ -176,73 +174,61 @@ class Message extends Entity
public
function
getMessageId
()
{
return
$this
->
message_id
;
}
public
function
getDate
()
{
return
$this
->
date
;
}
public
function
getFrom
()
{
return
$this
->
from
;
}
public
function
getChat
()
{
return
$this
->
chat
;
}
public
function
getForwardFrom
()
{
return
$this
->
forward_from
;
}
public
function
getForwardDate
()
{
return
$this
->
forward_date
;
}
public
function
getReplyToMessage
()
{
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
;
}
...
...
@@ -251,15 +237,14 @@ class Message extends Entity
$text
=
$this
->
text
;
if
(
$without_cmd
)
{
$command
=
$this
->
getFullCommand
();
if
(
!
empty
(
$command
)){
$text
=
substr
(
$text
,
strlen
(
$command
.
' '
),
strlen
(
$text
));
if
(
!
empty
(
$command
))
{
$text
=
substr
(
$text
,
strlen
(
$command
.
' '
),
strlen
(
$text
));
}
}
return
$text
;
}
public
function
botAddedInChat
()
{
if
(
!
empty
(
$this
->
new_chat_participant
))
{
...
...
@@ -267,12 +252,12 @@ class Message extends Entity
return
true
;
}
}
return
false
;
}
public
function
getType
()
{
return
$this
->
type
;
}
}
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