Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop username config key used by WebhookCommand only #979

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Laravel/Artisan/WebhookCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class WebhookCommand extends Command
* @var string
*/
protected $signature = 'telegram:webhook {bot? : The bot name defined in the config file}
{--all : To perform actions on all your bots.}
{--setup : To declare your webhook on Telegram servers. So they can call you.}
{--remove : To remove your already declared webhook on Telegram servers.}
{--all : To perform actions on all your bots.}
{--setup : To declare your webhook on Telegram servers. So they can call you.}
{--remove : To remove your already declared webhook on Telegram servers.}
{--info : To get the information about your current webhook on Telegram servers.}';
/**
* The console command description.
Expand Down Expand Up @@ -126,7 +126,7 @@ protected function getInfo()

if ($this->hasArgument('bot') && ! $this->option('all')) {
$response = $this->telegram->getWebhookInfo();
$this->makeWebhookInfoResponse($response, $this->config['username']);
$this->makeWebhookInfoResponse($response, $this->argument('bot'));

return;
}
Expand All @@ -135,7 +135,7 @@ protected function getInfo()
$bots = $this->botsManager->getConfig('bots');
collect($bots)->each(function ($bot, $key) {
$response = $this->botsManager->bot($key)->getWebhookInfo();
$this->makeWebhookInfoResponse($response, $bot['username']);
$this->makeWebhookInfoResponse($response, $key);
});
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/Laravel/config/telegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
|
| - name: The *personal* name you would like to refer to your bot as.
|
| - username: Your Telegram Bot's Username.
| Example: (string) 'BotFather'.
|
| - token: Your Telegram Bot's Access Token.
Refer for more details: https://core.telegram.org/bots#botfather
| Example: (string) '123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11'.
Expand All @@ -33,7 +30,6 @@
*/
'bots' => [
'mybot' => [
'username' => 'TelegramBot',
'token' => env('TELEGRAM_BOT_TOKEN', 'YOUR-BOT-TOKEN'),
'certificate_path' => env('TELEGRAM_CERTIFICATE_PATH', 'YOUR-CERTIFICATE-PATH'),
'webhook_url' => env('TELEGRAM_WEBHOOK_URL', 'YOUR-BOT-WEBHOOK-URL'),
Expand All @@ -43,7 +39,6 @@
],

// 'mySecondBot' => [
// 'username' => 'AnotherTelegram_Bot',
// 'token' => '123456:abc',
// ],
],
Expand Down