Git Product home page Git Product logo

guidebot's Introduction

Guide Bot

A boilerplate of a Discord.js Bot Handler. Updated and Maintained by the Idiot's Guide Community.

Guidebot is an attempt to show the basics of command and event handling, in clear, concise, and commented code. Guidebot can be used as the template for any type of bot, and contains most of the basic features you would need:

  • A command handler
  • A basic permission system
  • An event handler
  • Basic useful commands
  • Per-server configuration system
  • A logging system

Functionally guidebot is identical to guidebot class, but the difference is that guidebot class is created with classes whilst this version is purely function based.

Need support? Join the Idiot's Guide Community!

Requirements

  • git command line (Windows | Linux | MacOS) installed
  • node Version 16.x
  • The node-gyp build tools. This is a pre-requisite for Enmap, but also for a lot of other modules. See The Enmap Guide for details and requirements for your OS. Just follow what's in the tabbed block only, then come back here!

You also need your bot's token. This is obtained by creating an application in the Developer section of discord.com. Check the first section of this page for more info.

Intents

You can enable privileged intents in your bot page (the one you got your token from) under Privileged Gateway Intents.

By default GuideBot needs the Guilds, Guild Messages and Direct Messages intents to work. For join messages to work you need Guild Members, which is privileged. User counts that GuideBot has in places such as in the ready log, and the stats command may be incorrect without the Guild Members intent.

Intents are loaded from the index.js file, and the installer is pre-set with the Guilds, Guild Messages and Direct Messages intents.

For more info about intents checkout the official Discord.js guide page and the official Discord docs page.

Downloading

Create a folder within your projects directory and run the following inside it:

git clone https://github.com/anidiotsguide/guidebot.git .

Once finished:

  • In the folder from where you ran the git command, run npm install, which will install the required packages.
  • If you get any error about python or msibuild.exe or binding, read the requirements section again!
  • Rename config.js.example to config.js, and give it the required intents and any partials you may require.
  • Rename .env-example to .env and put in your bot token in it and save.

Starting the bot

To start the bot, in the command prompt, run the following command: node index.js

Inviting to a guild

To add the bot to your guild, you have to get an oauth link for it.

You can use this site to help you generate a full OAuth Link, which includes a calculator for the permissions: Permission Calculator

guidebot's People

Contributors

andrewjwin avatar ayplow avatar bakersbakebread avatar bannukde avatar bdistin avatar brandonremming avatar braxton avatar bryansuero avatar bziya avatar clemens-e avatar dependabot[bot] avatar dowzhong avatar eslachance avatar everlastingwonder avatar fierythunder avatar jmiln avatar lanndrich avatar lukenk avatar mrjacz avatar nathanielcwm avatar ognova avatar rmgirardin avatar soumil-07 avatar thetayloredman avatar vetlix avatar wilsonthewolf avatar yorkaargh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

guidebot's Issues

Commands not showing in help

I have recently noticed that some of my commands were not showing up in the help command list, I recently found out what was causing it. If you use a permissions number instead of its name, for example for a number "permLevel: 1" having it as a number makes the command not show up in help except the command still works fine... I fixed it by using the roles name, "permLevel: "User". Sorry if this is terribly explained...
P.S. I haven't tried much to fix this myself as it hasn't effected me to much.

Command handler is not recieving commands

To be honest i don't know if the problem is with the command handler, but i tried to make one using the guide, but when i try to use the command "+ping" i don't get a response

This is the code for the index.js

const fs = require('fs');
const Discord = require('discord.js');
const Enmap = require('enmap');
const client = new Discord.Client();
const config = require('./config.json');

client.config = config;

fs.readdir("./events/", (err, files) =>{
  if(err)return console.error(err);
  files.forEach(file => {
    const event = require(`./events/${file}`);
    let eventName = file.split(".")[0];
    console.log(`Loading: ${eventName}`);
    client.on(eventName, event.bind(null, client));
  });
});

client.commands = new Enmap();

fs.readdir("./commands/", (err, files)=>{
  if (err) return console.error(err);
  files.forEach(file=>{
    if(!file.endsWith(".js")) return;
    let props = require(`./commands/${file}`);
    let commandName = file.split(".")[0];
    console.log(`Loading ${commandName}`);
    client.commands.set(commandName, props);
  });
});

This is the code for ping.js

exports.run = (client,message,args)=>{
    message.channel.send("Ping").catch(console.error);
};

This is the code for the messages.js

module.exports = (client, message) => {
   
    if (message.author.bot)return;
    
    if(message.content.indexOf(client.config.prefix)!==0)return;

    const args = message.content.slice(client.config.prefix.length).trim().split(/ +/g);
    const command = args.shift().toLowerCase();

    const cmd = client.commands.get(command);
    console.log("yes");
    if(!cmd) return;

    cmd.run(client,message,args);
    
};

This is not a issue. More of a question of understanding.

So when I change a command setting to enabled: true to enabled: false, I still can use the command. Or do I bypass it since I am the owner?

  1. What does GuildOnly mean?

Sorry for the trouble. I am new to having all these new features in command handlers.

Upgrade to discord.js 12

Hello,
Is the transition to discord.js version 12 planned ?
We're starting to hear about it, but the changes seem significant...

Thank you !

event.bind is not a function.

hi there, i have just got your bot and i get this error in the console:
ERROR Unhandled rejection: TypeError: event.bind is not a function
can anyone help.

Handle eval output longer than 2000 characters

Currently if the output of the eval command is greater than the Discord message limit, the command errors and does not send any kind of message. If the output of the eval command is longer than the Discord message limit, the output should be logged elsewhere (maybe to console?) and a message should be sent letting the user know.

Client.loadCommand is not a function.

I get this error

(node:230) UnhandledPromiseRejectionWarning: TypeError: client.loadCommand is not a function
at /home/runner/testing/index.js:26:29
at Array.forEach ()
at init (/home/runner/testing/index.js:24:12)
(node:230) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:230) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

SyntaxError

hello, new installation. read guide, in config.js add ownerid and token, try start got that:

node index.js
/home/neoll/guidebot/index.js:9
const { promisify } = require("util");
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)
at node.js:966:3

is there a way to create a new role and permission?

I want to create a staff role that is level 1. Right above User. I tried doing this twice and it didn't work. I tried editing the config.js file to this and it didn't work. I made a new bot, edited the config.js file to the same code, before using the conf command, and it did not work.

Could I get some assistance to how to add a new role and permission? Thanks in advance.

Bot isn't responding to DMs

After upgrading and migrating to enmap v4 using the latest commits, I noticed I couldn't DM the bot anymore.

TypeError: Cannot read property 'id' of null at module.exports (/var/nodejs/guidebot/events/message.js:12:72) at emitOne (events.js:116:13) at Client.emit (events.js:211:7) at MessageCreateHandler.handle (/var/nodejs/guidebot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34) at WebSocketPacketManager.handle (/var/nodejs/guidebot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65) at WebSocketConnection.onPacket (/var/nodejs/guidebot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35) at WebSocketConnection.onMessage (/var/nodejs/guidebot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17) at WebSocket.onMessage (/var/nodejs/guidebot/node_modules/ws/lib/event-target.js:120:16) at emitOne (events.js:116:13) at WebSocket.emit (events.js:211:7)

This led me to message.js. message.guild.id was null, obviously since it was a DM.
const settings = message.settings = client.getSettings(message.guild.id);

It might not be the prettiest solution, and I'm totally not ruling out something wrong on my end, but this worked for me.
const settings = message.settings = client.getSettings(message.guild ? message.guild.id : "");

Discord Server Invite Invalid

It's most likely expired, but following this link as is shown in the guidebook and in the contributing guidelines brings you to an invalid invite.

Edit: The link that's at the header of the guidebook, does in fact work.

Suggestion

I got a settings suggestion, maybe make a setting to be able to hide a command from the help menu. I could use it to hide owner commands, again members can't use it, but it would be more tidy if we could just hide commands from the help menu, because they just kind of take up space.

Broken link in README.md

First section in README.md contains a broken link to the repository which seems either has been removed or set to private.

This command handler is 98% compatible with my selfbot

Installer issue

I'm not real clued in on the whole github thing, but post install configuration fails because in line 5 of setup.js it has:

let baseConfig = fs.readFileSync("./util/setup_base.txt", "utf8");

but it should be:

let baseConfig = fs.readFileSync("./installer/setup_base.txt", "utf8");

error when trying to start

hey, so I've got everything installed from the requirements and when I try to start the bot I get this how could I fix this?

Error cannot read property (default is always undefined)

imagen

Always i get some error when i try to interact with my bot, i haven't change a thing of the code apart from this one:
events/message.js
const settings = client.config.defaultSettings;
because withput that change i can't get the bot responde a thing :(

set command empty value

In line 24 of set.js:
if (!value) seems to be always false as u can parse "nothing".
After parsing "nothing" you can not change it back via "set edit key value" as the empty key can not be found by: if (!settings[key])

My solution for now:
if (!value && value == "")

How to create new settings?

This is not an issue but a question. I want to know how I can create more settings.

prefix, modLogChannel,modRole, adminRole, systemNotice, welcomeChannel, welcomeMessage, welcomeEnabled

These are the default settings for guilds. I want to add more settings. How can I do that?

I tried adding those settings in defaultSettings in setup.js file. But that didn't work.

Thanks in advance!

PS: The Discord Invite link in the repo's CONTRIBUTING.md is invalid. This made me open an issue.

level 0 User

So I put my id in ownerID but when I try to use an owner command it tells me
You do not have permission to use this command.
Your permission level is 0 (User)
This command requires level 10 (Bot Owner)
Any Ideas?

[PROPOSAL] Unknown command message

I noticed there is no message when you use command that doesn't exist (or misspell one that does), and I think it should be included by default. I know how to do this and would like to contribute to this project, what do you think?

DM is not working

There is no way to make a command for DM, even if "guildOnly: false". In the console nothing shows up.
if(message.channel.type == "dm") { console.log("Dm is working") }

Add permission nodes

This is here just for foramlity's sake. The idea has been discussed in the Discord server.

STEPS:

  • Base system
  • A way to manage nodes
  • A way to manage users into nodes

This suggestion is on hold

clean function only censors the client token once

Expected behavior
When running the eval command, the output replied by the bot censors every instance of the bot token.

Actual behavior
Only the first instance is censored.

Reproducing

!eval `${client.token} ${client.token}`

`make` error

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/dndrhead/.nvm/versions/node/v11.7.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:188:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.15.0-43-generic
gyp ERR! command "/home/dndrhead/.nvm/versions/node/v11.7.0/bin/node" "/home/dndrhead/.nvm/versions/node/v11.7.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dndrhead/guidebot/node_modules/leveldown
gyp ERR! node -v v11.7.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/dndrhead/.npm/_logs/2019-01-18T15_03_39_809Z-debug.log

Any ideas?
Node version: 11.7.0
Npm version: 6.5.0

Is there a way to have 2 message listeners

I'm running a webhook and bot merged together, so only passing commands with prefix through the message listener is not the best option for. Editing the message.js is not the best way to achieve those different type of listeners, so the optimal way would be to have 2 message.js, one for the webhook and one for the commands with prefix.

Is there any way to do this, with the module setup?

Crashes on DM

Since moving to the new friendly permission levels, when you DM the bot a command it crashes with the following error

Uncaught Exception:  TypeError: Cannot read property 'owner' of null
    at Object.check (C:\Users\YorkAARGH\Documents\GitHub\guidebot\config.js:45:40)
    at Client.client.permlevel.message [as permlevel] (C:\Users\YorkAARGH\Documents\GitHub\guidebot\modules\functions.js:19:24)
    at module.exports (C:\Users\YorkAARGH\Documents\GitHub\guidebot\events\message.js:32:24)
    at emitOne (events.js:115:13)
    at Client.emit (events.js:210:7)
    at MessageCreateHandler.handle (C:\Users\YorkAARGH\Documents\GitHub\guidebot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (C:\Users\YorkAARGH\Documents\GitHub\guidebot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:102:65)
    at WebSocketConnection.onPacket (C:\Users\YorkAARGH\Documents\GitHub\guidebot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:325:35)
    at WebSocketConnection.onMessage (C:\Users\YorkAARGH\Documents\GitHub\guidebot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:288:17)
    at WebSocket.onMessage (C:\Users\YorkAARGH\Documents\GitHub\guidebot\node_modules\ws\lib\EventTarget.js:103:16)

@eslachance
Steps to reproduce:

  1. Download latest code and run it
  2. DM the bot a command.

This also applies to the class-based branch.

secret & oauth help

Hi, I tried to login to the dashboard on localhost and when I authorized my application for oauth (i had the local host url included in the oauth section of the app) and I received an error on the /callback page and when I try to manually authorize it from the developers page and login through there it says UNKNOWN_ERROR. Am I able to get help on this???

npm ERR! code ELIFECYCLE

When i do npm install this error came up
> [email protected] install C:\Mybot\guidebot\guidebot\node_modu les\integer

node-gyp rebuild
C:\Mybot\guidebot\guidebot\node_modules\integer>if not defin
ed npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modu
les\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" reb
uild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-g
yp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Program Files\Python37\python.EXE -c im
port platform; print(platform.python_version());
gyp ERR! stack Traceback (most recent call last):
gyp ERR! stack File "", line 1, in
gyp ERR! stack File "E:\Program Files\Python36-32\Lib\platform.py", line 116,
in <module
gyp ERR! stack import sys, os, re, subprocess
gyp ERR! stack File "E:\Program Files\Python36-32\Lib\re.py", line 123, in <mo
dule
gyp ERR! stack import sre_compile
gyp ERR! stack File "E:\Program Files\Python36-32\Lib\sre_compile.py", line 17
, in module
gyp ERR! stack assert _sre.MAGIC == MAGIC, "SRE module mismatch"
gyp ERR! stack AssertionError: SRE module mismatch
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:275:12)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at Socket.emit (events.js:211:7)
gyp ERR! stack at Pipe._handle.close [as onclose] (net.js:557:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej
s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Mybot\guidebot\guidebot\node_modules\integer
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] requires a peer of bufferutil@^3.0.3 but none is inst
alled. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of erlpack@discordapp/erlpack but non
e is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-opus@^0.2.7 but none is insta
lled. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of opusscript@^0.0.6 but none is inst
alled. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of sodium@^2.0.3 but none is installe
d. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of libsodium-wrappers@^0.7.3 but none
is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of uws@^9.14.0 but none is installed.
You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\AppData\Roaming\npm-cache_logs\2018-09-03T04_50_25

243Z-debug.log

How to grab mentioned user's level?

Hi there! How do I fetch/grab a mentioned / otherwise selected (other than the message author) user's level? I'm trying to make a dynamic whois command that shows something different for level 8,9,10 users.
Any help is greatly appreciated! Thanks!

Unable to respond to DMs

Similar issue to #64 where I am getting the following error when a user responds to a DM sent by the bot:

Uncaught Promise Error: TypeError: Cannot read property 'me' of undefined at module.exports.run (C:\Users\MarcT\WebstormProjects\Discord-Bot\events\message.js:17:55) at Bot.client.on.args (C:\Users\MarcT\WebstormProjects\Discord-Bot\index.js:191:45) at Bot.emit (events.js:159:13) at MessageCreateHandler.handle (C:\Users\MarcT\WebstormProjects\Discord-Bot\node_modules\discord.js\src\client\websocket\ packets\handlers\MessageCreate.js:9:34) at WebSocketPacketManager.handle (C:\Users\MarcT\WebstormProjects\Discord-Bot\node_modules\discord.js\src\client\websocke t\packets\WebSocketPacketManager.js:103:65) at WebSocketConnection.onPacket (C:\Users\MarcT\WebstormProjects\Discord-Bot\node_modules\discord.js\src\client\websocket \WebSocketConnection.js:333:35) at WebSocketConnection.onMessage (C:\Users\MarcT\WebstormProjects\Discord-Bot\node_modules\discord.js\src\client\websocke t\WebSocketConnection.js:296:17) at WebSocket.onMessage (C:\Users\MarcT\WebstormProjects\Discord-Bot\node_modules\ws\lib\event-target.js:120:16) at WebSocket.emit (events.js:159:13) at Receiver._receiver.onmessage (C:\Users\MarcT\WebstormProjects\Discord-Bot\node_modules\ws\lib\websocket.js:137:47)

Which refers to the following:
// Cancel any attempt to execute commands if the bot cannot respond to the user. if (!message.channel.permissionsFor(message.guild.me).missing("SEND_MESSAGES")) return;
If I step pass this by commenting it out, the bot is then left in a state where it is unable to respond to the user, leaving no error behind either.

request

Multi language support, and change the using discord.js from v11 to v12.

Help Stopped Working..?

So the bot's been running fine for awhile, then i used the help command and everything stopped working.. any ideas?

Uncaught Exception: TypeError: Cannot read property 'permLevel' of undefined
at message.guild.client.commands.filter.cmd (C:\Users\Name\Desktop\guidebot\commands\help.js:16:97)
at Map.filter (C:\Users\Name\Desktop\guidebot\node_modules\enmap\src\index.js:254:11)
at Object.exports.run (C:\Users\Name\Desktop\guidebot\commands\help.js:16:56)
at module.exports (C:\Users\Name\Desktop\guidebot\events\message.js:66:7)
at emitOne (events.js:115:13)
at Client.emit (events.js:210:7)
at MessageCreateHandler.handle (C:\Users\Name\Desktop\guidebot\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\Name\Desktop\guidebot\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\Name\Desktop\guidebot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:330:35)
at WebSocketConnection.onMessage (C:\Users\Name\Desktop\guidebot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:293:17)

Individual Permission Support

Hey!

So, there are the perm levels, as defined in config.js, right? What if there were perm levels that checked for individual permissions? I know this can be done with code in the command itself, but what I'm looking for is a command that will run based on if they have a certain permission as defined in the exports.conf section. I made a makeshift example that doesn't actually work.. sort of. It works in that it doesn't show up in the help command if the user doesn't have the permission defined, but it doesnt work in that the command will still be run even if the user doesn't have the permission. Here's the code:

File: config.js

    // This level is actually a permission checking level. Use this for when you want to 
    // check if the user has a certain permission
    { level: 1,
      name: `Permission Check`,
      check: (message, cmd) => {
        try {
          if(message.member.permissions.has(cmd.conf.requires)) return true;
        } catch (e) {
          return false;
        }
      }
    },

File: addemote.js

module.exports.run = (client, message, args) => {
  var emojiName = args[0];
  var emojiURL = args[1];

  if (!emojiName) return message.channel.send(`:x: You forgot the emoji name!`);
  if (!emojiURL) return message.channel.send(`:x: You forgot the emoji url!`);

  message.guild.createEmoji(emojiURL, emojiName, null, `${message.author.tag} created emoji ${emojiName}`)
    .then(emote => {
      message.channel.send(`:white_check_mark: Emote **\`${emote.name}\`** ${emote} created!`);
    })
    .catch((err) => {message.channel.send(`:x: Something went wrong:\n${err}`);});
};

exports.conf = {
  enabled: true,
  guildOnly: true,
  aliases: [`ae`, `addemoji`, `createemoji`, `createemote`],
  permLevel: `Permission Check`,
  requires: `MANAGE_EMOJIS`
};

exports.help = {
  name: `addemote`,
  description: `Adds an emoji to the server`,
  usage: `addemote <name> <url>`,
  category: `Server`
};

Say command won't work in with command handler

When I try to use the say command the console returns this error:
(node:10380) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): DiscordAPIError: Cannot send an empty message
(node:10380) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

even when I writte something for the bot to copy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.