1.3.3 • Published 10 months ago

dvo.js v1.3.3

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

About

dvo.js is a powerful Node.js module that allows you to easily create discord bot. Documentation

Installation

Node.js 18.12.0 or newer is required.

npm install dvo.js

Example usage

Install dvo.js:

Create your own bot in Discord Developer Portal

const { DvoClient } = require('dvo.js');

let client = new DvoClient({
    token: "TOKEN_HERE",// Your discord bot token.
    clientId: "APP_ID_HERE",// Your bot ID.
    intents: ["Guilds", "MessageContent", "GuildMessages", "GuildMembers"],// Your bot intents.
    prefix: "!"// Message command prefix.
});

Make ready event

client.event({
    name: "ready",
    async execute() {
         console.log(`logged in ${client.user.tag}`)
    }
});

Make slash command bot

client.slashCommand({
    name: "ping",
    description: "Get bot ping",
    async execute(interaction) {
        interaction.reply(`Pong! \`${client.ping}ms\``)
    }
});

Make message command bot

client.command({
    name: "ping",
    async execute(message) {
        message.reply(`Pong! \`${client.ping}ms\``)
    }
});

Handler

in index.js

client.slashHandler('./slashCommands', client);
client.commandHandler('./prefixCommand', client);

in ./slashCommands/info/ping.js

module.exports = {
    name: "ping",
    description: "Get bot ping",
    async execute(interaction, client) {
        interaction.reply(`Pong! \`${client.ping}ms\``)
    }
}

in ./prefixCommands/info/ping.js

module.exports = {
    name: "ping",
    async execute(message, client) {
        message.reply(`Pong! \`${client.ping}ms\``)
    }
}

Ai usage

const { AI } = require('dvo.js');

module.exports = {
    name: "ai",
    description: "Ask ai",
    options: [{
        name: "input",
        description: "the input",
        type: 3,
        required: true
    }],
    async execute(interaction, client) {
  let ai = await Ai({content: interaction.options.getString("input")});
  interaction.reply(ai.choices[0]?.message?.content)
    }
}
1.3.3

10 months ago

1.3.2

10 months ago

1.3.1

10 months ago

1.3.0

10 months ago

1.2.1

10 months ago

1.2.0

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.0.1

10 months ago

0.0.7

10 months ago

0.0.5

10 months ago

0.0.1

10 months ago