About
Discorded is a simple Node.js that allows you to easily interact with the Discord API.
Advantages of Discorded:
- Built in command handler
- Planned to use less ram than other libs
- Easy to use
Discorded is still in alpha and a very early stage. Due to this, docs are still to be made.
Example usage
Raw Usage
const Discorded = ;const client = 'token'; client; client;
Using with the built in command handler
const Discorded = ; // This function returns the prefix for the context. { // Here you can have custom prefixes or whatever you want. // The prefix can be a string. return 'dc '; // Or a list of strings return 'dc ' 'dc.';} const client = 'token' getPrefix // Here is where we pass the getPrefix function to activate the command handler.; // This one is just simple ping command that sends pong to the channel.const ping = 'ping' { ctx;}; // This line loads the command to the command handler.client; const eval = 'eval' { ctx; } ownerOnly: true // This is where we pass checks, and other options like ownerOnly and nsfw ; // Here we load the command again.client; //This time let's make an array of commands. const commands = 'discorded' { ctx; } checks: ctxguildid === '513688996816224257' // The checks must be a list even if it has only one check. // If the check fails this sends `checkError` event with ctx as the only argument. 'dog' { // This is how you make embeds. let embed = title'Here is a dog for you.' 'optional url' // Here you can set the title. description'description' // The description color'hex or discorded.Color' // Sets the color of the embed. // Timestamp this takes a date item in it, the default is new Date() // adds a field to the embed. The last argument is inline and it is optional defaults to false // The author of the embed // Sets the footer // Image ; // Thumbnail ctx; // To send the embed you just pass it to the send method. } nsfw: true // If we want to make this command to only respond in nsfw channel we set this. If the command is invoked in non nsfw channel this sends `notNSFW` event with the context argument. ; // Then we can load a list of commands withclient; // Example handling for nsfw error// This fires when nsfw check fails.client; // Example handling for checkerror// This fires when a check fails.client; // Example handling for notOwner error// This fires when the ownerOnly check failsclient; // Even tho you are using the built in command handler it is not restricting you from using// The context or message eventclient; // This fires when the bot is ready.client;
Links
The absolute base for this library is forked from nodecord.