1.0.2 β€’ Published 7 months ago

easy-discord-embeds v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

easy-discord-embeds

License

A simple package to easily create and send embeds in Discord bots using discord.js. This package abstracts away the need to manually construct embed objects, allowing you to focus on what matters.

πŸ“¦ Installation

npm install easy-discord-embeds

πŸš€ Usage

Import the Library

For Node.js

const { sendEmbed } = require('easy-discord-embeds');

πŸ§‘β€πŸ’» Example Usage for Slash Commands

Here’s an example of how to use easy-discord-embeds with Slash Commands to send a simple embed in your Discord bot:

const { sendEmbed } = require('easy-discord-embeds');

module.exports = {
  data: {
    name: 'sendembed',
    description: 'Send an embed.',
  },
  async execute(interaction) {
    sendEmbed(interaction, {
      title: 'Simple Embed!',
      description: 'This is a simple description.',
      color: 0x3498db, // Blue color
    });
  },
};

πŸ§‘β€πŸ’» Example Usage for Message Commands

Here’s an example of how to use easy-discord-embeds with Message Commands (prefix-based commands) to send an embed:

const { sendEmbed } = require('easy-discord-embeds');

module.exports = {
  name: 'sendembed',
  description: 'Send an embed.',
  async execute(message) {
    sendEmbed(message, {
      title: 'Hello!',
      description: 'This is a message embed.',
      color: 0x00ff00, // Green color
    });
  },
};

🎨 Embed Options

Here’s how you can customize the embeds:

  • title: The title of the embed (string)
  • description: The content of the embed (string)
  • color: The color of the embed (hexadecimal value)
  • footer: Optional footer text (object with text and iconURL properties)
  • image: Optional image URL to display in the embed (string)
  • thumbnail: Optional thumbnail URL (string)
  • fields: Optional fields array, where each field has name, value, and optional inline (boolean)


πŸ§‘β€πŸ’» Example with Advanced Options:

sendEmbed(message, {
  title: 'Embed with Advanced Options',
  description: 'This embed has footer, image, and fields.',
  color: 0xff5733, // Red color
  footer: {
    text: 'Footer Text',
    iconURL: 'https://example.com/icon.png',
  },
  image: 'https://example.com/image.png',
  thumbnail: 'https://example.com/thumbnail.png',
  fields: [
    {
      name: 'Field 1',
      value: 'This is a field with some content.',
      inline: true,
    },
  ],
});

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago