Giter Site home page Giter Site logo

goated's Introduction

goated

a minimal discord API wrapper

features

  • unintrusive
  • automatically reads from .env
  • automatic command handling
  • command registration

why

When making discord-trolling and using discord.js, I found that their environments quickly became too bloated and complicated. That's why I'm making goated, to simplify the ecosystem even more.

usage

To use goated.js, start with the following code:

const { Client, Intents } = require("goated.js");

const client = new Client({
  intents: [Intents.Guilds], // bot intents
  commandsPath: `${__dirname}/commands` // path to folder with commands in it
});

client.env("./.env"); // login and read TOKEN and all other environment variables from .env

client.createCommand([
  {
    name: "test-command",
    description: "A test command",
    options: [
      {
        name: "test-option",
        description: "A test option",
        required: true, 
        type: Client.types.STRING,
      }
    ],
  }
], {
  id: process.env.APPLICATION_ID, // the bot ID in
  token: process.env.TOKEN, // the bot token
  guildId: process.env.GUILD_ID, // optional for registering guild-specific commands
});

Then, create a file with the same command name in the commands directory:

module.exports.run = (interaction) => { // the interaction parameter is from the discord.js library
  const option = interaction.options.getString("test-option");
  
  interaction.reply(`You provided the option: ${option}`)';
};

goated's People

Stargazers

 avatar

Watchers

 avatar

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.