Socket
Book a DemoInstallSign in
Socket

@progressive-victory/client

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@progressive-victory/client

Modified Discord.js client for discord bots

0.3.6
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

@progressive-victory/client

@progressive-victory/client is a general use Discord bot client that extends discord.js

Usage

Install of @progressive-victory/client:

npm install @progressive-victory/client
yarn add @progressive-victory/client

The client has a builting interation handler. and does not need the interactionCreate event to be added. The Client Does NOT support refix commands

Files setup

Example index.ts for a bot:

import { Client } from '@progressive-victory/client';

export const client = new Client({
    receiveMessageComponents: true,
    receiveModals: true,
    receiveAutocomplete: true,
    replyOnError: true,
    splitCustomID: true,
    splitCustomIDOn: '_',
    useGuildCommands: false
});

async function start() {
    await client.init({
        eventPath: './events',
        buttonPath: './interactions/buttons',
        selectMenuPath: './interactions/select_menus',
        modalPath: './interactions/modals',
        commandPath: './commands/chat/builders',
        contextMenuPath: './commands/context_menu'
    });

    await client.login(process.env.TOKEN);

    await client.deploy();
};

start();

How to use event objects

In a Dirctory path set in the eventPath Example event for Discord client event ready

import { Events } from 'discord.js';
import { Event, logger } from '@progressive-victory/client';

export default new Event()
    .setName(Events.ClientReady)
    .setOnce(true)
    .setExecute((client) => {
        logger.info(`Ready! Logged in as ${client.user.username}`);
    });

How to create command object

Command objects are a genaric and can be used for any object the following is the example of a button interaction. Button interactions should be placed in the Dirctory path set in the commandPath or contextMenuPath

import { ChatInputCommand } from '@progressive-victory/client';

export default new ChatInputCommand()
    .setBuilder(commandBuilder)
    .setGlobal(true)
    .setAutocomplete(autoCompletedFunction);
    .setExecute(executeFunction);

How to create interaction object

Interaction objects are a genaric and can be used for any object the following is the example of a button interaction. Button interactions should be placed in the dirctory path set in the buttonPath

import { ButtonInteraction } from 'discord.js';
import { Interaction, logger } from '@progressive-victory/client';

export default new Interaction<ButtonInteraction>()
    .setName(buttonCustomId)
    .setExecute(async (interaction) => {
        logger.info('button has been pressed');
    });

FAQs

Package last updated on 05 Mar 2024

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.