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
6bfd57b8
Commit
6bfd57b8
authored
Apr 21, 2017
by
Armando Lüscher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace all forgotten `getBotName` methods with new `getBotUsername`.
parent
abbb3e62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
HelpCommand.php
examples/Commands/HelpCommand.php
+1
-1
SendtochannelCommand.php
src/Commands/AdminCommands/SendtochannelCommand.php
+3
-3
Message.php
src/Entities/Message.php
+2
-2
No files found.
examples/Commands/HelpCommand.php
View file @
6bfd57b8
...
...
@@ -64,7 +64,7 @@ class HelpCommand extends UserCommand
if
(
$command
===
''
)
{
$text
=
sprintf
(
'%s v. %s'
.
PHP_EOL
.
PHP_EOL
.
'Commands List:'
.
PHP_EOL
,
$this
->
telegram
->
getBot
N
ame
(),
$this
->
telegram
->
getBot
Usern
ame
(),
$this
->
telegram
->
getVersion
()
);
...
...
src/Commands/AdminCommands/SendtochannelCommand.php
View file @
6bfd57b8
...
...
@@ -203,7 +203,7 @@ class SendtochannelCommand extends AdminCommand
if
(
$notes
[
'set_caption'
])
{
$data
[
'caption'
]
=
$notes
[
'caption'
];
}
$this
->
sendBack
(
new
Message
(
$notes
[
'message'
],
$this
->
telegram
->
getBot
N
ame
()),
$data
);
$this
->
sendBack
(
new
Message
(
$notes
[
'message'
],
$this
->
telegram
->
getBot
Usern
ame
()),
$data
);
$data
[
'reply_markup'
]
=
new
Keyboard
(
[
...
...
@@ -231,7 +231,7 @@ class SendtochannelCommand extends AdminCommand
if
(
$notes
[
'post_message'
])
{
$data
[
'text'
]
=
$this
->
publish
(
new
Message
(
$notes
[
'message'
],
$this
->
telegram
->
getBot
N
ame
()),
new
Message
(
$notes
[
'message'
],
$this
->
telegram
->
getBot
Usern
ame
()),
$notes
[
'channel'
],
$notes
[
'caption'
]
);
...
...
@@ -350,7 +350,7 @@ class SendtochannelCommand extends AdminCommand
$channels
=
(
array
)
$this
->
getConfig
(
'your_channel'
);
$first_channel
=
$channels
[
0
];
$data
[
'text'
]
=
$this
->
publish
(
new
Message
(
$message
->
getRawData
(),
$this
->
telegram
->
getBot
N
ame
()),
new
Message
(
$message
->
getRawData
(),
$this
->
telegram
->
getBot
Usern
ame
()),
$first_channel
);
}
...
...
src/Entities/Message.php
View file @
6bfd57b8
...
...
@@ -183,7 +183,7 @@ class Message extends Entity
$split_cmd
=
explode
(
'@'
,
$full_command
);
if
(
isset
(
$split_cmd
[
1
]))
{
//command is followed by name check if is addressed to me
if
(
strtolower
(
$split_cmd
[
1
])
===
strtolower
(
$this
->
getBot
N
ame
()))
{
if
(
strtolower
(
$split_cmd
[
1
])
===
strtolower
(
$this
->
getBot
Usern
ame
()))
{
return
$split_cmd
[
0
];
}
}
else
{
...
...
@@ -226,7 +226,7 @@ class Message extends Entity
{
$member
=
$this
->
getNewChatMember
();
return
$member
!==
null
&&
$member
->
getUsername
()
===
$this
->
getBot
N
ame
();
return
$member
!==
null
&&
$member
->
getUsername
()
===
$this
->
getBot
Usern
ame
();
}
/**
...
...
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