Eris is a very lightweight library for Discord API to use with bots. In my opinion, Eris is very much better than Discord.js. If you needed support, the link to get it is: https://abal.moe/Eris/docs/getting-started
If you don’t know how to setup this up at all, you can press the Remix button and make it off of that.
This project will updated frequently and if you need any support with this project, ask here ;^).
Looking at the example, I’d like to suggest a few changes to it.
First off would be replacing that lonely var with const. Using var is a bad habit while you should only be using let and const. This is due to the fact that var pollutes global namespace, causes issues with shadowing, can easily cause memory leaks where you wouldn’t expect, is slower, and a bunch more things.
Secondly, I suggest using async msg instead of just msg as it’s cleaner, makes error handling along with debugging much easier, and so much more.
I also think that the example could contain a bit more like a ping and/or an echo command. There is so much you could show with your example.
Eris was a very stable and fast framework. The only sad part is that getting help with it was hard. Most of the time when I googled stuff for eris I got stuff for discord.js. I just wish that the documentation was more helpful. I’d like it if there was a large “cookbook” section also.
There’s a framework called pysimplegui, that allows you to write code once and it will be compatible with various GUI toolkits and even the web. If we could make a framework that can use both eris and discord.js then everyone could work without the worries of choosing the right framework.
That’s why I like botkit because it has cross platform plugins. So you can turn your Discord bot into a Twitter or other bot if you want. There is a botkit-discord connector though that uses discord.js. Someone could make one that uses Eris.
What you don’t understand is that Discord.js is basic and a library most users have heard of, it’s the go-to library for those new to programming a Discord bot, whereas compared to Eris, there are not many tutorials on it and not many people have heard of it.
Its documented pretty well but its not very user friendly, it could be documented with examples etc and the documentation site could do with a re design
Yeah, I was thinking of making some tutorials on it, most of the tutorials on YT I’ve seen so far just include the basic ping command, and that’s about it.
Example: Ping Pong
Create a file called example.js. Add the following code to it:
var bot = new Eris(“BOT_TOKEN”);
bot.on(“ready”, () => {
console.log(“Ready!”);
});
bot.on(“messageCreate”, (msg) => {
if(msg.content === “!ping”) {
bot.createMessage(msg.channel.id, “Pong!”);
}
});
bot.connect();
Then, run the example with: node example.js