Skip to content
프로젝트

소개

A fully-featured HTTP library for Discord bots

개발 도구

이 수치를 측정하는 방법

What you can do

  • Build every common interaction type in one place: slash commands, user/message commands, buttons, select menus, and modals.
  • Start with simple HTTP interactions, then add Gateway or Gateway Forwarder only when your bot needs non-interaction events.
  • Run the same bot across Node.js, Bun, and Fetch-style runtimes like Cloudflare Workers or Next.js.
  • Components can register themselves automatically, and you can still register them globally or per command when you need persistence.

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Carbon

Carbon WordmarkDiscord NPM Version NPM Downloads

Carbon is a fully typed Discord bot framework for TypeScript that helps you ship quickly with HTTP interactions first, then scale into richer features through plugins, reusable classes, and optional Gateway support without rewriting your architecture later.

Features

  • Build every common interaction type in one place: slash commands, user/message commands, buttons, select menus, and modals.
  • Start with simple HTTP interactions, then add Gateway or Gateway Forwarder only when your bot needs non-interaction events.
  • Run the same bot across Node.js, Bun, and Fetch-style runtimes like Cloudflare Workers or Next.js.
  • Components can register themselves automatically, and you can still register them globally or per command when you need persistence.
  • For quick flows, you can parse custom IDs cleanly and wait for a single component click with replyAndWaitForComponent.
  • Use prechecks and wildcard handlers to add safety rules and fallback behavior without turning command code into a mess.
  • Host multiple Discord applications from one deployment with ClientManager.
  • Grow through plugins like Linked Roles, Command Data, Paginator, Sharding, and Voice.
  • Tune request/event processing with queue lanes, concurrency controls, and runtime metrics when traffic grows.

Installation

To get started with Carbon, you can check out the Getting Started guides for your preferred platform.

Caching

Carbon is serverless-first, so entity caching is off by default. Opt in with the cache plugin:

import { MemoryCachePlugin } from "@buape/carbon/cache"

const client = new Client(options, handlers, [
	new MemoryCachePlugin({
		default: { maxSize: 5000, ttl: 60_000 },
		types: {
			users: { maxSize: 20_000, ttl: 300_000 },
			messages: { maxSize: 1000, ttl: 30_000 }
		}
	})
])

Redis-compatible clients are supported without adding Redis to Carbon's core bundle:

import { RedisCachePlugin } from "@buape/carbon/cache"

const client = new Client(options, handlers, [
	new RedisCachePlugin({ client: redis, prefix: "my-bot" })
])

Custom stores only need small get, set, and delete style methods and can be configured globally or per cache type.

Useful Links

Contributing

We welcome contributions to Carbon! If you're interested in contributing, please check out the Contributing Guide for more information, and join our Discord to get involved!

관련 프로젝트 살펴보기

불러오는 중…