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
a82a421e
Unverified
Commit
a82a421e
authored
Feb 02, 2018
by
Armando Lüscher
Committed by
GitHub
Feb 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into credits
parents
a0de02df
56298a17
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
CHANGELOG.md
CHANGELOG.md
+1
-0
DB.php
src/DB.php
+0
-4
Telegram.php
src/Telegram.php
+6
-0
No files found.
CHANGELOG.md
View file @
a82a421e
...
...
@@ -6,6 +6,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
## [Unreleased]
### Added
### Changed
-
Add debug log entry instead of throwing an exception for duplicate updates.
### Deprecated
### Removed
### Fixed
...
...
src/DB.php
View file @
a82a421e
...
...
@@ -492,10 +492,6 @@ class DB
$update_id
=
$update
->
getUpdateId
();
$update_type
=
$update
->
getUpdateType
();
if
(
count
(
self
::
selectTelegramUpdate
(
1
,
$update_id
))
===
1
)
{
throw
new
TelegramException
(
'Duplicate update received!'
);
}
// @todo Make this simpler: if ($message = $update->getMessage()) ...
if
(
$update_type
===
'message'
)
{
$message
=
$update
->
getMessage
();
...
...
src/Telegram.php
View file @
a82a421e
...
...
@@ -457,6 +457,12 @@ class Telegram
//This is necessary to "require" all the necessary command files!
$this
->
getCommandsList
();
//Make sure we don't try to process update that was already processed
if
(
count
(
DB
::
selectTelegramUpdate
(
1
,
$this
->
update
->
getUpdateId
()))
===
1
)
{
TelegramLog
::
debug
(
'Duplicate update received, processing aborted!'
);
return
Request
::
emptyResponse
();
}
DB
::
insertRequest
(
$this
->
update
);
return
$this
->
executeCommand
(
$command
);
...
...
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