quick-embed
v1.0.3132
Published
Quickly transform your bot responses into an embed instead of plain, boring content!
Downloads
7
Readme
quick-embed
Introduction
Quickly transform your bot responses into an embed instead of plain, boring content!
Information
This is a simple package for turning your bot replies into embeds. You must have discord.js version 14 or above installed to use this package.
This package was developed specifically for Discord bot development and will only function as intended if used with discord.js.
Code Samples
This is a basic ping command for your Discord.JS v14 bot that makes use of the QuickEmbed package.
const { SlashCommandBuilder, CommandInteraction } = require("discord.js");
const QuickEmbed = require("quick-embed"); // Import the QuickEmbed module from the quick-embed package.
module.exports = {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("View the current latency of the Discord bot."),
async execute(interaction, client) {
const ping = client.ws.ping;
// Create an embed easily.
QuickEmbed({
desc: `Ping: ${ping}ms`, // Set the description for your embed.
interaction: interaction,
});
},
};
Installation
To install the package, simply enter
npm i quick-embed@latest
into your terminal.
Error Codes
If an issue occurs with the package, please check your terminal for an explanation. Otherwise, if you received an error code, please refer to the table below for possible fixes.
| Error code | Explanation | Solution |
| --- | --- | --- |
| ERR_NO_INTERACT
| This error will occur if you did not enter the interaction option or if you entered an invalid interaction. | You may fix this by adding interaction: interaction to your QuickEmbed code.
| ERR_NO_DESC
| This error will occur if you fail to provide a description for your embed or if you provide an invalid string. Supported string formats include '', "", or backticks, ``. | The correct format is desc: ""
| ERR_INVALID_COLOR
| This error occurs when the color for the embed is not formatted correctly. Please specify your chosen embed color in hex-code format. | color: "#ff0000" is an example of an appropriate method for setting the embed color.