Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Eklavya-11/discord-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-client

Custom client for discord.js

About

Discord.CLIENT was created to simplify the wide use of Discord.js for beginners.

The first version was created by Eklavya11 at 15/09/2019.

Installation

Discord.js@11.x & above and Node.js@8.x & above is necessary to use Discord.CLIENT, to install:

  • Node.js (Linux):
    sudo apt-get install nodejs
    
  • Node.js (Windows):

    You can download Node.js here: nodejs.org

  • Discord.js:
    npm install --save discord.js
    (And make sure to have the this repo downloaded)
    

Example usage

const Discord = require('discord.js');
const bot = new Discord.Client();

const { Client } = require('discord-client'); // or use src
bot.cli = new Client(bot);

bot.on('ready', () => {
    bot.cli.setGame('I\'m online !');
    console.log(`Logged in as ${bot.user.tag}!`);
});

bot.on('message', msg => {
    if (msg.content === 'info') {
        bot.cli.utils.findMember(msg, msg.author.id).then((res) => { // You can find a member with username instead of ID
            let embed = new Discord.RichEmbed()
            .setTitle(res.user.tag)
            .setThumbnail(res.user.displayAvatarURL)
            .addField('Name', res.user.username)
            .addField('Tag', res.user.discriminator)
            .addField('Bot', res.user.bot ? 'Yes' : 'No');
            bot.cli.message.create({
                to: msg.channel.id,
                attachEmbed: embed
            });
        });
    }
});

bot.login('token');

About

Custom client for discord.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published