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

Examples

View .md

/serverinfo

Show your server's name, owner, members, boosts and age in one embed.

Shows facts about your server in a neat embed.

My Server Owner: @Sam · Members: 1,204 · Boosts: 7 (level 2) Created: March 3, 2021

Setup#

Create a slash command and switch to Advanced.

FieldValue
Command Nameserverinfo
DescriptionAbout this server

No arguments.

Code#

Pre-hook:

python
created = int(server.created_at.timestamp())

set_embed(Message(
    title=server.name,
    description=server.description,
    thumbnail=server.icon_url,
    color="#5865F2",
    fields=[
        ("Owner", f"<@{server.owner_id}>", True),
        ("Members", intcomma(server.member_count), True),
        ("Boosts", f"{server.premium_subscription_count} (level {int(server.premium_tier)})", True),
        ("Roles", str(len(server.get_roles())), True),
        ("Channels", str(len(server.get_channels())), True),
        ("Created", f"<t:{created}:D> (<t:{created}:R>)", True),
    ],
))

Leave the Content / Reply Message box empty.

PartJob
fields=[...]Each field is (name, value, inline). True puts fields side by side.
intcomma(...)Writes 1204 as 1,204.
<t:...:D>A Discord timestamp. Each reader sees the date in their own format.
<t:...:R>Shows "3 years ago".

Note

server.description and server.icon_url are empty when the server has none. The embed then leaves them out.

Related#

  • /avatar shows a member's picture.
  • Objects lists everything you can read from server.
  • Embeds lists every Message(...) field.
Previous/avatarNext /rank

On this page

  • Setup
  • Code
  • Related
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