Socket
Socket
Sign inDemoInstall

@igecorp/ige-djs

Package Overview
Dependencies
186
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @igecorp/ige-djs

Ige-DJS is a discord.js extends module made by IgeCorp


Version published
Maintainers
1
Created

Readme

Source

IgeDJS

IgeDJS is a npm module

Documentation

https://igecorp.js.org

Installation

Latest version
npm i @igecorp/ige-djs
Dev Version

Must have git on your device

npm i github:IgeCorp/ige-djs

Example

Login CLient

index.js

const IgeDJS = require("@igecorp/ige-djs");

const client = new IgeDJS.IgeClient("Discord Bot Token", {
    replies: true, //Replace "replies: true" by "replies: false" if you don't want any mentions.
    owner: "ownerId", //Replace this string by an Array of strings: ["id 1", "id 2", "..."]
    testGuild: "guild id" //this is for client guild only slashs
});

client.param({
    slashsDir: "slashs", //Replace it by your client commands directory.
    eventsDir: "events" //Replace it by your client events directory.
});

events/ready.js

module.exports = async (client) => {
    console.log(`${client.user.tag} is ready.`);

    client.postSlashs(client.slashs); // this will post the client commands

    client.user.setActivity(`I'm using @igecorp/ige-djs npm module !`, { type: "PLAYING" });
}

events/interactionCreate.js

module.exports = async (client, interaction) => {
    if (interaction.isCommand()) {
        if (interaction.commandName) {
            try {
                await client.slashs.get(interaction.commandName).run(interaction); // Get the slash with the interaction command name and run it
            } catch(err) {
                console.error(err);
                await interaction.reply({
                    content: "An error as occured",
                    ephemeral: true
                });
            }
        }
    }
}

slashs/ping.js

const IgeDJS = require("@igecorp/ige-djs");

class ping extends IgeDJS.IgeCommand {
    constructor() {
        super({
            name: "ping",
            description: "Get the client latency",
            category: "utility",
            guildOnly: true // change this to false to make this command to global (all client guilds)
        });
    }

    async run(interaction) {
        await interaction.reply({
            content: `Pong: \`${Date.now() - message.createdTimestamp}ms\``
        });
    }
}

module.exports = new ping;

© 2021 Copyright: IgeCorp

Keywords

FAQs

Last updated on 08 Feb 2022

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