1.0.22 • Published 3 years ago

javascript-cord v1.0.22

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
3 years ago

Table of contents

About

JSCord is a discord.js framework to easily maintain discord bots.
Note: This is still in beta and some features may not be working

Installation

Node.js 12.0.0+ is required. Install with npm:

$ npm i javascript-cord

Examples

Basic

const JSC = require('javascript-cord');

const client = new JSC.JSClient(); // Declaring the new client

client.on("message", (msg) => {
    if (msg.content === "!hello") {
        msg.create("Hello world!")
    } else if (msg.content === "!ping") {
        msg.create(`Pong! ${msg.ping}!`)
    }
});

client.start("TOKEN"); // Start your bot, replacing TOKEN with your bot's token, remember to NEVER share your token with ANYONE.

Commands

const JSC = require("javascript-cord");

const client = new JSC.JSClient();

let prefix = "?";

client.on("message", async (message) => {
    const args = message.content.slice(prefix.length).trim().split(/ +/);
    const cmd = args.shift().toLowerCase();

    if (cmd === "hi") {
        message.create("Hi!")
    } else if (cmd === "bye") {
        message.create("Oh okay, bye")
    } else if (cmd === "foo") {
        message.create("bar")
    }
});

client.start("TOKEN")

Contributing

Links

1.0.22

3 years ago

1.0.21

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago