Skip to content

Instantly share code, notes, and snippets.

@LingleDev
Last active March 13, 2019 23:35
Show Gist options
  • Save LingleDev/f39c912580d878ba5bdb96b2608dcadd to your computer and use it in GitHub Desktop.
Save LingleDev/f39c912580d878ba5bdb96b2608dcadd to your computer and use it in GitHub Desktop.
README.md for Discode

Discode

Discode is a new and lightweight Node.js wrapper for the Discord API. It offers new features including webhook functions and more. The goal of this project was to use a significantly less amount of RAM than discord.js. I succeeded.

Getting Started

How to make a basic ping pong bot:

    const discord = require('discode')
    const bot = new discord.Client('some crazy token')

    /* fires when the bot is ready to respond to Discord */

    bot.on('ready', () => {
        console.log("%s is ready.", bot.user.username)
    })

    /* fires when a message comes in */

    bot.on('message', msg => {
        const prefix = "!"

        if (msg.content == prefix+"ping") {
            msg.reply("PONG!")
        }

        if (msg.content == prefix+"pong") {
            msg.reply("PING!")
        }
    })

Additional Info

This is a very young project. You cannot send messages from channels yet, as I still have some bug patching to do. The only current way to send a message to a channel is msg.reply.

I'm still working on custom objects like Guilds, GuildMembers, Users, and other things. I don't know when I'll be able to update this, but when I do, the update will probably be big.

Future Updates

I don't know for sure, but I think I might implement voice features. I have no idea what I'm doing in the voice department, but I'll try to learn as best as I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment