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
7c3b0b3a
Commit
7c3b0b3a
authored
Jan 03, 2016
by
MBoretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating doc
parent
19048f8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
README.md
README.md
+7
-0
DB.php
src/DB.php
+7
-3
No files found.
README.md
View file @
7c3b0b3a
...
...
@@ -212,6 +212,13 @@ All types implemented according to Telegram API (2015 November).
### Methods
All methods implemented according to Telegram API (2015 November).
####Send Message
Message longer than 4096 characters are splitted in more message.
```
php
$result
=
Request
::
sendMessage
([
'chat_id'
=>
$chat_id
,
'text'
=>
'Your utf8 text 😜 ...'
]);
```
####Send Photo
To send a local photo provide the file path as second param:
...
...
src/DB.php
View file @
7c3b0b3a
...
...
@@ -151,8 +151,12 @@ class DB
*
* @return string
*/
protected
static
function
toTimestamp
(
$time
)
protected
static
function
getTimestamp
(
$time
=
null
)
{
if
(
is_null
(
$time
))
{
$time
=
time
();
}
return
date
(
'Y-m-d H:i:s'
,
$time
);
}
...
...
@@ -239,9 +243,9 @@ class DB
$chat_id
=
$chat
->
getId
();
$date
=
self
::
to
Timestamp
(
$message
->
getDate
());
$date
=
self
::
get
Timestamp
(
$message
->
getDate
());
$forward_from
=
$message
->
getForwardFrom
();
$forward_date
=
self
::
to
Timestamp
(
$message
->
getForwardDate
());
$forward_date
=
self
::
get
Timestamp
(
$message
->
getForwardDate
());
$photo
=
$message
->
getPhoto
();
$new_chat_participant
=
$message
->
getNewChatParticipant
();
...
...
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