Skip to content
On this page

Modals manager

Set up an modals managers to load modals interactions events.

Setup in client

When setting up the client, it is possible to set the manager as a parameter :

js
const { ShewenyClient } = require('sheweny');

const client = new ShewenyClient({
  intents: ['Guilds'],
  managers: {
    modals: {
      directory: './interactions/modals', // Directory where modals interactions are stored
    },
  },
});
ts
import { ShewenyClient } from 'sheweny';

const client = new ShewenyClient({
  intents: ['Guilds'],
  managers: {
    modals: {
      directory: './interactions/modals', // Directory where modals interactions are stored
    },
  },
});

Setup with class

You can also use the class to set up the manager somewhere else :

js
const { ShewenyClient, ModalsManager } = require('sheweny');

const client = new ShewenyClient({ intents: ['GUILDS'] });

const ModalsManager = new ModalsManager(client, {
  directory: './interactions/modals', // Directory where the modals are stored
});

ModalsManager.loadAll();
ts
import { ShewenyClient, ModalsManager } from 'sheweny';

const client = new ShewenyClient({ intents: ['GUILDS'] });

const ModalsManager = new ModalsManager(client, {
  directory: './interactions/modals', // Directory where the modals are stored
});

ModalsManager.loadAll();