Skip to content
@Tempcord

Tempcord

Modern PHP Discord bot framewrk

Tempcord logo

Tempcord

Build Discord bots with modern PHP.

PHP 8.5 or newer Latest Tempcord Framework version Latest Tempcord starter version MIT License

Documentation · Quick start · Discord

Tempcord is an open-source framework for building Discord bots with PHP 8.5+, powered by Tempest. Define commands, events, and interactive components as typed PHP classes; Tempcord discovers them and handles their Discord registration and routing.

Why Tempcord

  • PHP-native interactions — slash commands, options, events, buttons, select menus, modals, and autocomplete are declared with PHP attributes.
  • Typed by default — PHP parameter types drive Discord option types and give your IDE useful information.
  • Built on Tempest — use dependency injection and the same discovery model across commands, listeners, and plugins.
  • Gateway-aware — read cached guilds, channels, roles, members, and voice states without turning every lookup into a REST request.
  • Extensible — add reusable plugins, scheduled tasks, or an HTTP server that shares the bot's container and event loop.

Quick start

Create a bot project and run the interactive setup:

composer create-project tempcord/tempcord my-bot
cd my-bot
php tempcord init

The setup wizard stores and verifies your bot token, provides an invite link, and can register the starter commands for you.

When commands change, register them as the bot starts:

php tempcord boot --register

For normal starts, registration is not required:

php tempcord boot

A command is a PHP class

<?php

namespace App\Commands;

use Tempcord\Attributes\Command;
use Tempcord\Discord\Interaction\CommandInteraction;

#[Command(description: 'Ping? Pong!')]
final readonly class PingCommand
{
    public function __invoke(CommandInteraction $interaction): void
    {
        $interaction->reply('Pong!');
    }
}

The class name becomes /ping. Add typed parameters with #[Option], or use the same attribute-first model for events and interactive components.

The Tempcord ecosystem

Repository Purpose
tempcord Starter project and the recommended way to create a new bot
framework Core framework, runtime, and source-generated documentation
discord-php Async Discord REST API and gateway wrapper used by the framework
tasks Scheduled tasks discovered and resolved like other Tempcord handlers
http HTTP routes running inside the bot on its event loop

Learn and contribute

Tempcord is under active development. Its packages are released under the MIT License.

Pinned Loading

  1. framework framework Public

    Discord Bot Framework written in PHP based on TempestPHP

    PHP 1

  2. tempcord tempcord Public

    Temcord - Build discord bots with PHP

    PHP

Repositories

Showing 6 of 6 repositories

Top languages

Loading…

Most used topics

Loading…