-
app/Console/Commands/PromotePost.php
Open in GitHubuse Illuminate\Console\Command; use Illuminate\Support\Facades\Http; use Spatie\Emoji\Emoji; class PromotePost extends Command { public function handle(): int { // $response = Http::post( sprintf('https://api.telegram.org/bot%s/sendMessage', config('services.telegram.bot_token')), [ 'chat_id' => config('services.telegram.chat_id'), 'text' => Emoji::orangeBook().' '.$post->title.PHP_EOL.$post->url, ] ); // } }
-
config/services.php
Open in GitHubreturn [ 'telegram' => [ 'bot_token' => env('TELEGRAM_BOT_TOKEN'), 'chat_id' => '-1001286676640', // Http::get(sprintf('https://api.telegram.org/bot%s/getUpdates', $token))->json()['result'][0]['channel_post']['chat']['id'] ], ];