1.1.3 • Published 1 year ago

goated.js v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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}`)';
};
1.1.3

1 year ago

1.1.1

1 year ago

1.1.2

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago