Custom Commands docsCustom CommandsDocs

Search docs

Find a page, function or guide

HomeSupportDashboard

Getting started

  • Introduction
  • Your first command
  • How a command runs
  • Variables in replies
  • Text commands
  • Events
  • Using Slushy

Guides

  • Welcome messages
  • Role menus
  • Auto moderation
  • Social alerts
  • Moderation commands
  • Levels and XP
  • Economy and coins
  • Ticket system
  • Giveaways
  • Poll
  • Button game
  • Reminders

Concepts

  • Buttons and menus
  • Forms
  • Saving data
  • Permissions and cooldowns
  • Limits and premium
  • Common mistakes

API reference

  • Response
  • Messages
  • Embeds
  • Members and roles
  • Channels
  • Storage
  • Checks
  • Views
  • Components
  • Modals
  • Interactions
  • Paginators
  • Web and files
  • Scheduling
  • Server events and polls
  • Time
  • Waiting
  • Utilities
  • Objects
  • Event variables

Examples

  • /8ball
  • /coinflip
  • /avatar
  • /serverinfo
  • /rank
  • /remind

Getting started

View .md

Your first command

Make a /hello command that greets whoever runs it. Takes two minutes.

You will make /hello. When someone runs it, the bot replies:

Hello @Alex, welcome to My Server!

Before you start#

  1. Add the bot to your server.
  2. Open the dashboard and pick your server.

You need the Manage Server permission in that server.

1. Create the command#

On the dashboard, open Create → Slash Command.

Fill in Basic details:

FieldValue
Command Namehello
DescriptionSay hello

The description shows under the command name in Discord's command menu. Keep it short.

Note

Names use lowercase letters, numbers, - and _. No spaces. Discord rule.

2. Write the reply#

Scroll to Response. In Content / Reply Message, type:

text
Hello {user.mention}, welcome to {server.name}!

Text inside { } is a variable. The bot fills it in when the command runs:

VariableBecomes
{user.mention}A ping of the person who ran the command
{user.display_name}Their name, without a ping
{server.name}Your server's name
{server.member_count}How many members the server has
{channel.mention}The channel the command ran in

3. Save#

Press Save. The command is now on the dashboard.

Discord needs to learn about new commands. The dashboard does this for you. If you see Sync required at the top, press Sync now.

4. Try it#

In your server, type /hello and press Enter.

Command not showing?

Discord can take up to a minute. Press Ctrl + R to reload Discord. Still missing? Check the bot has the Use Application Commands permission in that channel.

Make it better#

Only the user sees the reply#

Under Behavior, turn on Only the user sees the reply. Good for help commands, so the chat stays clean.

Add an option#

Under Arguments, add a Member argument named friend. Then change the reply:

text
{user.mention} says hello to {friend.mention}!

Every argument becomes a variable with the same name.

Use an embed#

Make an embed under Embeds, then pick it in Reply Embed. Variables work in embeds too.

Add some code#

Want a random pick? Open Pre-hook and add:

python
greeting = random(["Hello", "Hi", "Hey", "Welcome"])

Then use it in the reply:

text
{greeting} {user.mention}!

The pre-hook runs before the reply is sent. Anything you make there can go in the reply with { }.

PreviousIntroductionNext How a command runs

On this page

  • Before you start
  • 1. Create the command
  • 2. Write the reply
  • 3. Save
  • 4. Try it
  • Make it better
  • Only the user sees the reply
  • Add an option
  • Use an embed
  • Add some code
Custom CommandsCustom Commands

The #1 Custom Commands Discord bot — build commands, events and databases with zero boilerplate.

Join the support server

Product

  • Overview
  • Why us?
  • Premium
  • Template shop

Features

  • AI Agent
  • Reaction roles
  • Welcome messages
  • Embed builder
  • Social alerts
  • Custom bot

Resources

  • Docs
  • Blog
  • Support
  • Dashboard

Company

  • Privacy
  • Terms
  • Contact
contact@ccbot.app

2 Frederick Street, London, WC1X 0ND

Payments secured by Stripe

© WEiRDSOFT LTD. All rights reserved.

Custom Commands