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
184504bd
Commit
184504bd
authored
Sep 02, 2015
by
MBoretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix phpcs syntax
parent
64860c5f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
ServerResponse.php
src/Entities/ServerResponse.php
+1
-1
Request.php
src/Request.php
+1
-2
Telegram.php
src/Telegram.php
+3
-1
No files found.
src/Entities/ServerResponse.php
View file @
184504bd
...
...
@@ -32,7 +32,7 @@ class ServerResponse extends Entity
$this
->
result
=
new
Message
(
$data
[
'result'
],
$bot_name
);
$this
->
error_code
=
null
;
$this
->
description
=
null
;
}
elseif
(
$data
[
'ok'
]
&
$data
[
'result'
]
==
1
)
{
}
elseif
(
$data
[
'ok'
]
&
$data
[
'result'
]
==
1
)
{
//Response from setWebhook set
$this
->
ok
=
$data
[
'ok'
];
$this
->
result
=
$data
[
'result'
];
...
...
src/Request.php
View file @
184504bd
...
...
@@ -76,7 +76,7 @@ class Request
$fake_response
[
'ok'
]
=
1
;
// :)
//some fake data just to let iniatilize the class method SendMessage
if
(
isset
(
$data
[
'chat_id'
]))
{
if
(
isset
(
$data
[
'chat_id'
]))
{
$data
[
'message_id'
]
=
'123'
;
$data
[
'date'
]
=
'123'
;
$data
[
'chat'
]
=
array
(
'id'
=>
$data
[
'chat_id'
]
);
...
...
@@ -135,7 +135,6 @@ class Request
public
static
function
setWebhook
(
$url
)
{
$result
=
self
::
send
(
'setWebhook'
,
array
(
'url'
=>
$url
));
return
$result
;
}
...
...
src/Telegram.php
View file @
184504bd
...
...
@@ -792,7 +792,9 @@ class Telegram
$result
=
Request
::
setWebhook
(
$url
);
if
(
!
$result
->
isOk
())
{
throw
new
TelegramException
(
'Webhook was not set! Error: '
.
$result
->
getErrorCode
()
.
' '
.
$result
->
getDescription
());
throw
new
TelegramException
(
'Webhook was not set! Error: '
.
$result
->
getErrorCode
()
.
' '
.
$result
->
getDescription
()
);
}
return
$result
;
...
...
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