New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

embed-creator

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embed-creator

Discord Embed Creation

latest
Source
npmnpm
Version
1.2.4
Version published
Maintainers
1
Created
Source

Embed Creator

This module assumes you have basic knowledge of Discord.js.

A Discord Embed Creator

Key

const ce = require("embed-creator");

msg.channel.send(ce(
  "hex code color", "author object", "title",
  "description",
  "fields object",
  "footer object",
  "image object", "is timestamp enabled (true/false)"
));

Edit Example

const ce = require("embed-creator");
msg.channel.send("A message with no embed!").then(theM => {
  theM.edit(ce(
    "#FFFFFF", null, "This message has an embed now! :D"
  ));
});

Object Examples

Hex, Title, Description, Timestamp

#FFFFFF, null, "Title", "Description", null, null, null, false

Author

{"name": "Fire", "icon_url": msg.guild.displayAvatarURL(), "url": "https://www.google.com"}

Fields

[{"name": "Field 1", "value": "Value 1"}, {"name": "Field 2", "value": "Value 2"}]
{"text": "This is footer text!", "icon_url": msg.guild.iconURL()}

Images

{"thumbnail": msg.guild.iconURL(), "image": msg.author.displayAvatarURL()}

Example

This example will show you how to use every part of embedCreator.

const ce = require("embed-creator");

msg.channel.send(ce(
  "#FEAFEA", {"name": "Fire", "icon_url": msg.author.displayAvatarURL(), "url": "https://www.google.com"}, "Title", "Description",
  [{"name": "Field 1", "value": "Value 1"}, 
   {"name": "Field 2", "value": "Value 2"}],
  {"text": "This is footer text!", "icon_url": msg.guild.iconURL()}, 
  {"thumbnail": msg.guild.iconURL(), "image": msg.author.displayAvatarURL()}, false
));

Example1

Keywords

discord

FAQs

Package last updated on 29 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts