Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

705 B
Raw Blame
<?php

declare(strict_types=1);

namespace App\Console\Commands\Telegram;

use App\Actions\SocialAccount\RegisterTelegramWebhook;
use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;
use Throwable;

#[Signature('telegram:set-webhook')]
#[Description('Register the Telegram bot webhook with the configured URL and secret token')]
class SetWebhook extends Command
{
    public function handle(): int
    {
        try {
            $url = RegisterTelegramWebhook::execute();
        } catch (Throwable $e) {
            $this->error($e->getMessage());

            return self::FAILURE;
        }

        return self::SUCCESS;
    }
}