Socket
Socket
Sign inDemoInstall

addox

Package Overview
Dependencies
102
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    addox

A powerful, easy-to-use library that allows you to interact with the Discord API.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

ADDOX

About

addox is an easy-to-use Node.js library for interacting with the Discord API's.

Installation

npm install addox
yarn add addox

Warn

Node.js v16.6.0 or higher is required.

Features

  • Easy to use
  • Object-oriented
  • Lightweight
  • Fast
  • TypeScript support

Optional Dependencies

  • zlib-sync for WebSocket data compression and decompression
  • erlpack for WebSocket data serialization and deserialization

Example ping-pong

const {
    Client,
    ApplicationCommandBuilder,
    EmbedBuilder,
    ButtonBuilder,
    ActionRowBuilder,
} = require('addox');

const client = new Client({
    ws: {
        intents: ['Guilds'],
    },
});

client.ws.on('ready', () => {
    const commands = [
        new ApplicationCommandBuilder().setName('ping').setDescription('Replies with pong!')
    ];

    client.caches.commands
        .set(commands)
        .then(() => console.log('Application commands (/) registered!'))
        .catch(console.error);

    console.log(`Logged in as ${client.user.tag}!`);
});

client.ws.on('interactionCreate', async (interaction) => {
    if (interaction.type === 'ApplicationCommand' && interaction.commandType === 'ChatInput') {
        switch (interaction.commandName) {
            case 'ping':
                await interaction.reply({
                    content: `Pong! **${client.ws.ping}**ms`,
                });
                break;
        }
    }
});

client.ws.connect('your-super-secret-token');

Contributing

If you want to contribute to addox, you can do so by forking the repository and submitting a pull request.

Keywords

FAQs

Last updated on 06 Apr 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