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
202d8d75
Commit
202d8d75
authored
May 25, 2016
by
Jack'lul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another fix for botan
parent
4fd2d0a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
Botan.php
src/Botan.php
+16
-12
No files found.
src/Botan.php
View file @
202d8d75
...
...
@@ -86,19 +86,21 @@ class Botan
$obj
=
json_decode
(
$input
,
true
);
if
(
isset
(
$obj
[
'message'
]))
{
$data
=
$obj
[
'message'
];
$event_name
=
'Message'
;
if
((
isset
(
$obj
[
'message'
][
'entities'
])
&&
$obj
[
'message'
][
'entities'
][
0
][
'type'
]
==
'bot_command'
&&
$obj
[
'message'
][
'entities'
][
0
][
'offset'
]
==
0
)
||
(
substr
(
$obj
[
'message'
][
'text'
],
0
,
1
)
==
'/'
&&
$obj
[
'message'
][
'text'
]
!=
'/'
))
{
if
(
isset
(
$obj
[
'message'
][
'entities'
])
&&
is_array
(
$obj
[
'message'
][
'entities'
]))
{
foreach
(
$obj
[
'message'
][
'entities'
]
as
$entity
)
{
if
(
$entity
[
'type'
]
==
'bot_command'
&&
$entity
[
'offset'
]
==
0
)
{
if
(
strtolower
(
$command
)
==
'generic'
)
{
$command
=
'Generic'
;
}
elseif
(
strtolower
(
$command
)
==
'genericmessage'
)
{
$command
=
'Generic Message'
;
}
else
{
$command
=
'/'
.
strtolower
(
$command
);
}
$event_name
=
'Command ('
.
$command
.
')'
;
}
else
{
$event_name
=
'Message'
;
$event_name
=
'Command ('
.
$command
.
')'
;
break
;
}
}
}
}
elseif
(
isset
(
$obj
[
'inline_query'
]))
{
$data
=
$obj
[
'inline_query'
];
...
...
@@ -115,6 +117,8 @@ class Botan
return
false
;
}
self
::
$command
=
''
;
$uid
=
$data
[
'from'
][
'id'
];
$request
=
str_replace
(
[
'#TOKEN'
,
'#UID'
,
'#NAME'
],
...
...
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