1.0.1 • Published 6 years ago

simpleembed v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
6 years ago

SimpleEmbed

Hi to you ! This npm module was developed especially for discord.js, it will allow you to easily create messages containing embed.

The first advantage is that your code will not be "flood", so you'll have better readability

For download the npm module, it's here !

Link :

How to install

In order to use this module, you need to install some other npm as below :

cd /your_project/node_modules
npm install discord.js
npm install fs
npm install simpleembed

To be able to use this module, you will need a file in JSON format which will contain the code defining the parameters of your embed.

It should be composed as follows (do not hesitate to copy and paste). If you have invalid parameters in your JSON file, please keep these lines and leave the quotation marks empty

[
  {
      "title": "string",
      "url": "string(url)"
      "author":
      {
          "name": "string",
          "imageURL": "string(url)"
      },

      "color": "string(with #)",
      "description": "string",
      "footer":
      {
          "value": "string",
          "imageURL": "string(url)"
      },

      "thumbnail": "string(url)",
      "date": bool,
      "field":
      [
          {
              "title": "string",
              "value": "string",
              "inline": bool
          }
      ]
  }
]

To have more field, you can duplicate this fragment of code in the field array :

{
   "title": "string",
   "value": "string",
   "inline": bool
}

In your JS file, you should require the module.

The embed function :

CreateEmbed(path, placeSending)
ParametersUsing
pathLink to your JSON file
placeSendingPlace who you want to send your embed

Then, you can call a embed function :

const Discord = require('discord.js');
const bot = new Discord.Client({autoReconnect: true, max_message_cache: 0});

const SE = require('simpleembed')

bot.on('message', message => {

    if (message.author.bot) return
    
    SE.CreateEmbed("./embed.json", message.channel)

})

Thanks you for reading me project !

1.0.1

6 years ago

1.0.0

6 years ago