0.0.2-0 • Published 5 years ago

embedify.js v0.0.2-0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

About

Embedify is a simple library that interfaces with Discord.js to make working with embeds just a tad bit easier, and comes with some helper functions to make the everyday Discord bot developers life a little bit easier.

Installation

  • With NPM: npm install embedify
  • With Yarn: yarn install embedify

Usage

Quick Embedding (content is set as Rich Embed's description)

const Discord = require('discord.js')
const Client = new Discord.Client()
// this gets just the embedify function from the module, importing no other functions
const { embedify } = require('embedify.js')

Client.on('message', (message) => {
    if(message.content === 'embedify') {
        message.channel.send(embedify('Your message was just embedified!'))
    }
})

Client.login(process.env.BOT_TOKEN)

More advanced usage, importing the entire library to use more features

const Discord = require('discord.js')
const Client = new Discord.Client()
// to reduce redundancy calling functions, it might be useful to define Embedify as 'e' or something simple
const embedify = require('embedify.js')

Client.on('message', (message) => {
    if(message.content === 'embedify') {
        message.channel.send(embedify.embedify('Can you believe it\'s this easy to make embeds in your messages?'))
    }
    // chaining is possible with native Discord.js rich embed methods 
    else if(message.content === 'embedify and chain image') {
        message.channel.send(embedify.embedify('Let\'s chain an image to our embedded text').setImage('./example/assets/example.jpg'))
    }
})

Client.login(process.env.BOT_TOKEN)

Embedify has a config feature that can be set in two ways

  • Using inline embedify methods
const embedify = require('embedify.js')

embedify.config({
    color: ["you can choose one color", "or have many to randomize the color"]
})

// OR

embedify.config().color("you can choose one color", "or have many to randomize the color")
  • Using a embedconfig.json file, must be placed in the root directory of your project
{
    "color": ["you can choose one color", "or have many to randomize the color"]
}

For more usage, check out the examples

0.0.2-1

5 years ago

0.0.2-0

5 years ago