7xz

work / discord-cpv2

Discord Components V2 Reference

Every Discord Components V2 type in one runnable file: a reference you copy from instead of reading docs.

Year
2026
Category
tools
Stack
Python · discord.py
Status
reference
Repo
https://github.com/NoahDesroisers/Discord-CPv2-example

When Discord Components V2 shipped, the docs alone did not make it clear how the pieces fit together. This is one file that builds a message with every component type, so you copy the shape you need instead of going back and forth between docs and code.

How it works

One cpv2.py, written in March 2026. It uses discord.py for the gateway and slash commands, but sends the Components V2 payload as raw JSON over bot.http.request rather than through discord.py’s own component classes, so it does not depend on the library’s V2 support. Each example runs as-is when pasted.

Covered: Action Row, Button in all five styles, the String / User / Role / Mentionable / Channel selects, Section with a Thumbnail or a Button accessory, Text Display, Thumbnail, Media Gallery, File, Separator, and Container with accent colour and spoiler. A single message caps at 40 components.

Where it stands

Repo: github.com/NoahDesroisers/Discord-CPv2-example

esc
  • Pages

    • Home page
    • Work page
    • Log page
    • About page
    • Now page
    • Colophon page
    • Search page
    • lab · live neural network page
  • Work

    • 7xz Lab 2026 · live work
    • Neural network foundational theory 2026 · research work
    • Context-Aware Zone Alert 2025 · shipped work
    • FORA 2026 · shipped work
    • Discord Components V2 Reference 2026 · reference work
    • News Credibility Auditor 2025 · archived work
  • Log

    • AI 딥보이스 탐지 대회 참가 기록, DACON 2026.09.29 · research log
    • 이론적 아름다움과 유체역학으로 가지치기를 시도, NavierFlow 2026.05.18 · research log
    • AI STT앱 개발 시도기, Project L mate 2026.03.04 · project log
    • 포트폴리오 사이트 구축기 2025.11.30 · project log
  • Actions

    • Toggle theme action
    • Toggle content language (KR / EN) action
    • Search everything action