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
0f8e0275
Unverified
Commit
0f8e0275
authored
Feb 07, 2019
by
Armando Lüscher
Committed by
GitHub
Feb 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #925 from jacklul/rip_botan
Deprecate Botan.io integration
parents
2cfb8a7e
71e9ef96
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
21 deletions
+10
-21
CHANGELOG.md
CHANGELOG.md
+1
-0
Botan.php
src/Botan.php
+4
-0
BotanDB.php
src/BotanDB.php
+2
-0
Telegram.php
src/Telegram.php
+3
-21
No files found.
CHANGELOG.md
View file @
0f8e0275
...
...
@@ -7,6 +7,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Added
### Changed
### Deprecated
-
Botan.io service has been discontinued.
### Removed
### Fixed
### Security
...
...
src/Botan.php
View file @
0f8e0275
...
...
@@ -18,6 +18,8 @@ use Longman\TelegramBot\Exception\TelegramException;
/**
* Class Botan
*
* @deprecated Botan.io service is no longer working
*
* Integration with http://botan.io statistics service for Telegram bots
*/
class
Botan
...
...
@@ -64,6 +66,8 @@ class Botan
*/
public
static
function
initializeBotan
(
$token
,
array
$options
=
[])
{
trigger_error
(
'Longman\TelegramBot\Botan::initializeBotan is deprecated and will be removed in future release.'
,
E_USER_DEPRECATED
);
if
(
empty
(
$token
))
{
throw
new
TelegramException
(
'Botan token is empty!'
);
}
...
...
src/BotanDB.php
View file @
0f8e0275
...
...
@@ -15,6 +15,8 @@ use Longman\TelegramBot\Exception\TelegramException;
/**
* Class BotanDB
*
* @deprecated Botan.io service is no longer working
*/
class
BotanDB
extends
DB
{
...
...
src/Telegram.php
View file @
0f8e0275
...
...
@@ -123,13 +123,6 @@ class Telegram
*/
protected
$last_command_response
;
/**
* Botan.io integration
*
* @var boolean
*/
protected
$botan_enabled
=
false
;
/**
* Check if runCommands() is running in this session
*
...
...
@@ -527,19 +520,9 @@ class Telegram
//Handle a generic command or non existing one
$this
->
last_command_response
=
$this
->
executeCommand
(
'generic'
);
}
else
{
//Botan.io integration, make sure only the actual command user executed is reported
if
(
$this
->
botan_enabled
)
{
Botan
::
lock
(
$command
);
}
//execute() method is executed after preExecute()
//This is to prevent executing a DB query without a valid connection
$this
->
last_command_response
=
$command_obj
->
preExecute
();
//Botan.io integration, send report after executing the command
if
(
$this
->
botan_enabled
)
{
Botan
::
track
(
$this
->
update
,
$command
);
}
}
return
$this
->
last_command_response
;
...
...
@@ -905,16 +888,16 @@ class Telegram
/**
* Enable Botan.io integration
*
* @deprecated Botan.io service is no longer working
*
* @param string $token
* @param array $options
*
* @return \Longman\TelegramBot\Telegram
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public
function
enableBotan
(
$token
,
array
$options
=
[])
{
Botan
::
initializeBotan
(
$token
,
$options
);
$this
->
botan_enabled
=
true
;
trigger_error
(
'Longman\TelegramBot\Telegram::enableBotan is deprecated and will be removed in future release.'
,
E_USER_DEPRECATED
);
return
$this
;
}
...
...
@@ -947,7 +930,6 @@ class Telegram
}
$this
->
run_commands
=
true
;
$this
->
botan_enabled
=
false
;
// Force disable Botan.io integration, we don't want to track self-executed commands!
$result
=
Request
::
getMe
();
...
...
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