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
b1c17cae
Commit
b1c17cae
authored
Aug 23, 2016
by
Avtandil Kikabidze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed code style by phpcbf
parent
7ddb9386
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
13 deletions
+32
-13
WeatherCommand.php
src/Commands/UserCommands/WeatherCommand.php
+1
-1
DB.php
src/DB.php
+23
-6
Request.php
src/Request.php
+1
-1
Telegram.php
src/Telegram.php
+1
-1
TelegramLog.php
src/TelegramLog.php
+6
-4
No files found.
src/Commands/UserCommands/WeatherCommand.php
View file @
b1c17cae
...
...
@@ -60,7 +60,7 @@ class WeatherCommand extends UserCommand
throw
new
TelegramException
(
$e
->
getMessage
());
}
return
(
string
)
$response
->
getBody
();
return
(
string
)
$response
->
getBody
();
}
/**
...
...
src/DB.php
View file @
b1c17cae
...
...
@@ -296,8 +296,11 @@ class DB
$sth_insert_telegram_update
->
bindParam
(
':chat_id'
,
$chat_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':message_id'
,
$message_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':inline_query_id'
,
$inline_query_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':chosen_inline_result_id'
,
$chosen_inline_result_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':chosen_inline_result_id'
,
$chosen_inline_result_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':callback_query_id'
,
$callback_query_id
,
PDO
::
PARAM_INT
);
$sth_insert_telegram_update
->
bindParam
(
':edited_message_id'
,
$edited_message_id
,
PDO
::
PARAM_INT
);
...
...
@@ -458,8 +461,15 @@ class DB
if
(
self
::
insertChosenInlineResultRequest
(
$chosen_inline_result
))
{
$chosen_inline_result_local_id
=
self
::
$pdo
->
lastInsertId
();
return
self
::
insertTelegramUpdate
(
$update_id
,
null
,
null
,
null
,
$chosen_inline_result_local_id
,
null
,
null
);
return
self
::
insertTelegramUpdate
(
$update_id
,
null
,
null
,
null
,
$chosen_inline_result_local_id
,
null
,
null
);
}
}
elseif
(
$update
->
getUpdateType
()
==
'callback_query'
)
{
$callback_query
=
$update
->
getCallbackQuery
();
...
...
@@ -474,8 +484,15 @@ class DB
if
(
self
::
insertEditedMessageRequest
(
$edited_message
))
{
$chat_id
=
$edited_message
->
getChat
()
->
getId
();
$edited_message_local_id
=
self
::
$pdo
->
lastInsertId
();
return
self
::
insertTelegramUpdate
(
$update_id
,
$chat_id
,
null
,
null
,
null
,
null
,
$edited_message_local_id
);
return
self
::
insertTelegramUpdate
(
$update_id
,
$chat_id
,
null
,
null
,
null
,
null
,
$edited_message_local_id
);
}
}
...
...
src/Request.php
View file @
b1c17cae
...
...
@@ -176,7 +176,7 @@ class Request
//Fix so that the keyboard markup is a string, not an object
if
(
isset
(
$data
[
'reply_markup'
])
&&
!
is_string
(
$data
[
'reply_markup'
]))
{
$data
[
'reply_markup'
]
=
(
string
)
$data
[
'reply_markup'
];
$data
[
'reply_markup'
]
=
(
string
)
$data
[
'reply_markup'
];
}
$request_params
=
[
'debug'
=>
$debug_handle
];
...
...
src/Telegram.php
View file @
b1c17cae
...
...
@@ -307,7 +307,7 @@ class Telegram
if
(
$response
->
isOk
())
{
//Process all updates
foreach
((
array
)
$response
->
getResult
()
as
$result
)
{
foreach
((
array
)
$response
->
getResult
()
as
$result
)
{
$this
->
processUpdate
(
$result
);
}
}
...
...
src/TelegramLog.php
View file @
b1c17cae
...
...
@@ -160,10 +160,12 @@ class TelegramLog
{
if
(
self
::
$debug_log_temp_stream_handle
!==
null
)
{
rewind
(
self
::
$debug_log_temp_stream_handle
);
self
::
debug
(
sprintf
(
$message
,
stream_get_contents
(
self
::
$debug_log_temp_stream_handle
)
));
self
::
debug
(
sprintf
(
$message
,
stream_get_contents
(
self
::
$debug_log_temp_stream_handle
)
)
);
fclose
(
self
::
$debug_log_temp_stream_handle
);
self
::
$debug_log_temp_stream_handle
=
null
;
}
...
...
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