Socket
Socket
Sign inDemoInstall

goated.js

Package Overview
Dependencies
42
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    goated.js

a minimal discord API wrapper


Version published
Weekly downloads
17
decreased by-22.73%
Maintainers
1
Install size
26.9 MB
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 06 May 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc