Custom Commands homeCustom Commands
  • Blog
  • Privacy
  • Premium
  • Support
Back to blog
// blog

Create and send custom embed to a channel programatically using custom commands bot

To create a embed and send it to a channel programmitically using pre hook

Md Shahriyar Alam

2 years ago

·1 min read

Construct Embed

Custom commands bot has its own way of defining Embeds, Follow the instructions below.

py
myEmbed = Message(
  content="Message outside embed",
  title="This is title",
  url="https://ccbot.app", # A link thats clickable on title
  description="This is just a description",
  color=0xffffff, # Any hex code here followed by `0x`
  fields=[
    ("Field Title", "Field Value", true), # last one is inline value can be true or false
    ("Another Field", "This is awesome", true),
  ],
  image="https://i.ibb.co/XpK0FLG/slash-commands.png", # Any image here
  thumbnail="https://i.ibb.co/XpK0FLG/slash-commands.png", # Any image here
  footer="This is footer text",
  footer_icon="https://i.ibb.co/XpK0FLG/slash-commands.png", # Icon shows beside footer
  timestamp=interaction.created_at, # For current time
  author=user.username,
  author_icon=user.avatar_url,
  author_url="https://ccbot.app"
)

Send the embed

py
send_message(channel_id, myEmbed)

Both code must be in pre or post hook.

Loading comments…

{}

Need help?

Have a question, a suggestion, or stuck on something? Reach out — we're happy to help.

DiscordJoin support server
Custom CommandsCustom Commands

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

Links

HomeBlogPrivacySupport

Contact

[email protected]

2 Frederick StreetLondon, WC1X 0ND

{ / } custom commands

© WEiRDSOFT LTD. All rights reserved.