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.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Api;
use App\Actions\SocialAccount\ListDiscordChannels;
use App\Enums\SocialAccount\Platform;
use App\Exceptions\PlatformUnavailableException;
use App\Models\SocialAccount;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class DiscordController extends Controller
{
public function channels(Request $request, SocialAccount $account): JsonResponse
{
$this->authorize('view', $account);
if ($account->platform !== Platform::Discord) {
return response()->json(
['message' => 'Channels are only available for Discord accounts.'],
Response::HTTP_UNPROCESSABLE_ENTITY,
);
}
try {
return response()->json([
'channels' => ListDiscordChannels::execute($account),
]);
} catch (PlatformUnavailableException $e) {
return response()->json(
['message' => $e->getMessage()],
Response::HTTP_BAD_GATEWAY,
);
}
}
}