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
59faa330
Commit
59faa330
authored
Mar 28, 2016
by
LONGMAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code style fixes
parent
af6f4df3
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
225 additions
and
409 deletions
+225
-409
composer.lock
composer.lock
+214
-397
ChatsCommand.php
src/Commands/AdminCommands/ChatsCommand.php
+1
-1
ConversationDB.php
src/ConversationDB.php
+1
-1
DB.php
src/DB.php
+4
-4
Chat.php
src/Entities/Chat.php
+1
-1
Message.php
src/Entities/Message.php
+1
-1
ServerResponse.php
src/Entities/ServerResponse.php
+1
-1
Request.php
src/Request.php
+2
-3
No files found.
composer.lock
View file @
59faa330
This diff is collapsed.
Click to expand it.
src/Commands/AdminCommands/ChatsCommand.php
View file @
59faa330
...
...
@@ -54,7 +54,7 @@ class ChatsCommand extends AdminCommand
foreach
(
$results
as
$result
)
{
//Initialize a chat object
$result
[
'id'
]
=
$result
[
'chat_id'
];
$result
[
'id'
]
=
$result
[
'chat_id'
];
$chat
=
new
Chat
(
$result
);
if
(
$chat
->
isPrivateChat
())
{
...
...
src/ConversationDB.php
View file @
59faa330
...
...
@@ -171,7 +171,7 @@ class ConversationDB extends DB
$where
.=
'WHERE '
;
}
++
$tokens_counter
;
$where
.=
'`'
.
$field
.
'`= :'
.
$tokens_counter
;
$where
.=
'`'
.
$field
.
'`= :'
.
$tokens_counter
;
$tokens
[
':'
.
$tokens_counter
]
=
$value
;
}
...
...
src/DB.php
View file @
59faa330
...
...
@@ -147,7 +147,7 @@ class DB
$query
.=
'ORDER BY `id` DESC'
;
if
(
!
is_null
(
$limit
))
{
$query
.=
' LIMIT :limit '
;
$query
.=
' LIMIT :limit '
;
}
$sth_select_telegram_update
=
self
::
$pdo
->
prepare
(
$query
);
...
...
@@ -182,7 +182,7 @@ class DB
$query
.=
'ORDER BY '
.
TB_MESSAGE
.
'.`message_id` DESC'
;
if
(
!
is_null
(
$limit
))
{
$query
.=
' LIMIT :limit '
;
$query
.=
' LIMIT :limit '
;
}
$sth
=
self
::
$pdo
->
prepare
(
$query
);
...
...
@@ -684,7 +684,7 @@ class DB
if
(
!
is_null
(
$date_from
))
{
$where
[]
=
TB_CHAT
.
'.`updated_at` >= :date_from'
;
$tokens
[
':date_from'
]
=
$date_from
;
$tokens
[
':date_from'
]
=
$date_from
;
}
if
(
!
is_null
(
$date_to
))
{
...
...
@@ -692,7 +692,7 @@ class DB
$tokens
[
':date_to'
]
=
$date_to
;
}
$a
=
0
;
$a
=
0
;
foreach
(
$where
as
$part
)
{
if
(
$a
)
{
$query
.=
' AND '
.
$part
;
...
...
src/Entities/Chat.php
View file @
59faa330
...
...
@@ -49,7 +49,7 @@ class Chat extends Entity
public
function
isGroupChat
()
{
if
(
$this
->
type
==
'group'
||
$this
->
id
<
0
)
{
if
(
$this
->
type
==
'group'
||
$this
->
id
<
0
)
{
return
true
;
}
return
false
;
...
...
src/Entities/Message.php
View file @
59faa330
...
...
@@ -236,7 +236,7 @@ class Message extends Entity
public
function
getFullCommand
()
{
if
(
substr
(
$this
->
text
,
0
,
1
)
===
'/'
)
{
$no_EOL
=
strtok
(
$this
->
text
,
PHP_EOL
);
$no_EOL
=
strtok
(
$this
->
text
,
PHP_EOL
);
$no_space
=
strtok
(
$this
->
text
,
' '
);
//try to understand which separator \n or space divide /command from text
...
...
src/Entities/ServerResponse.php
View file @
59faa330
...
...
@@ -99,7 +99,7 @@ class ServerResponse extends Entity
//must be an array
protected
function
isAssoc
(
array
$array
)
{
return
(
bool
)
count
(
array_filter
(
array_keys
(
$array
),
'is_string'
));
return
(
bool
)
count
(
array_filter
(
array_keys
(
$array
),
'is_string'
));
}
public
function
isOk
()
{
...
...
src/Request.php
View file @
59faa330
...
...
@@ -208,9 +208,8 @@ class Request
//Logging getUpdates Update
//Logging curl updates
if
(
$action
==
'getUpdates'
&
self
::
$telegram
->
getLogVerbosity
()
>=
1
|
self
::
$telegram
->
getLogVerbosity
()
>=
3
)
{
if
(
$action
==
'getUpdates'
&
self
::
$telegram
->
getLogVerbosity
()
>=
1
|
self
::
$telegram
->
getLogVerbosity
()
>=
3
)
{
self
::
setInputRaw
(
$result
);
self
::
log
(
$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