1.0.5 • Published 2 years ago

guildmanager.xyz v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

guildmanager.xyz API

Encuentra toda la información en https://guildmanager.xyz/api/docs

Ejemplo:

  import { Client } from 'discord.js'; // Únicamente v13
  import { Client as GMClient } from 'guildmanager.xyz';

  const client = new Client({intents: 3276799});
  /*
    Intents obligatorios:
    - GUILD_MESSAGES
    - GUILD_VOICE_STATES
  */

  const gm = new GMClient({
    key: 'API_KEY', // Tu llave de autorización
    manageVoicePanels: true // Habilitar paneles de voz
  });

  client.once('ready', () => {
    gm.start(client); // Iniciar el cliente de guildmanager.xyz
    gm.once('connected', () => {
      gm.importSlashCommands(); // Solo es necesario usarlo una vez, esto añade los comandos de barra diagonal
    });

    gm.on('error', (type, message) => { // Errores de la API de Guild Manager
      console.log(`GM-API Error [${type}]: ${message}`);
    });

    /*
      Eventos de Websocket
      gm.socket.onAny((eventName, ...params) => {
        // Posibles eventos:
        //  - TICKET_CREATE
        //  - TICKET_CLOSED
        //  - TICKET_REOPENED
        //  - VALORATION_ADD
        //  - VALORATION_CANCEL
        //  - TICKET_UNCLAIM
        //  - TICKET_CLAIM
        //  - TICKET_DELETED
        
      });
    */
  });

  client.login('DISCORD_CLIENT_TOKEN'); // Iniciar el cliente de discord.js