Introduction npm i dvo.js

Creating the bot

From this code you can make the bot.

Code Example: npm install dvo.js

        // Importing the DvoClient class
        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.
        });
                

Note

Create your own bot from Discord Developer portal and get bot token and id && Enable the intents. if your bot verified you can customize the intents in createtion code

Warning

Prefix only for message command

Intents Available:
  • Guilds
  • GuildPresences
  • GuildMembers
  • GuildMessages
  • GuildMessageContent
  • GuildVoiceStates
  • GuildInvites
  • GuildEmojisAndStickers
  • GuildWebhooks
  • GuildInteractions
  • GuildScheduledEvents
  • GuildAutomodRules
  • DirectMessages
  • DirectMessageReactions
  • MessageContent

Functions

There is a functions to help you in making a command.

Embeder

      const { Embeder } = require("dvo.js");
      
      client.command({
          name: "embed",
          async execute(message) {
      
              let embed = new Embeder()
                  .color(0x0099FF)
                  .title("Some title")
                  .url("https://i.ibb.co/PDJgc24/1.png")
                  .author("Some name", "https://i.ibb.co/PDJgc24/1.png", "https://discord.gg/wc5w9SVfzP")
                  .description("some description here")
                  .thumbnail("https://i.ibb.co/PDJgc24/1.png")
                  .addField("Regular field title", "Some value here")
                  .addField("Inline field title", "Some value here", true)
                  .addField("Inline field title", "Some value here", true)
                  .addField("Inline field title", "Some value here", true)
                  .image("https://i.ibb.co/PDJgc24/1.png")
                  .timestamp()
                  .footer("Some footer text here", "https://i.ibb.co/PDJgc24/1.png")
              message.reply({embeds: [embed.build()]})
          }
      });
              

ButtonCreator

      // Creating buttons using ButtonCreator
      const { ButtonCreator } = require('dvo.js');
      
      client.command({
        name: "button",
        async execute(message) {
              const button = new ButtonCreator(
                  {
                      label: 'Primary',
                      style: 'Primary',  // Ensure this matches Dvo.js supported styles
                      customId: '1'
                  },
                  {
                      label: 'Secondary',
                      style: 'Secondary',  // Ensure this matches Dvo.js supported styles
                      customId: '2'
                  },
                  {
                      label: 'Success',
                      style: 'Success',  // Ensure this matches Dvo.js supported styles
                      customId: '3'
                  },
                  {
                      label: 'Danger',
                      style: 'Danger',  // Ensure this matches Dvo.js supported styles
                      customId: '4'
                  },
                  {
                      label: 'Link',
                      style: 'Link',  // Ensure this matches Dvo.js supported styles
                      url: "https://i.ibb.co/4j7xgSc/image.png"
                  }
              );
      
              const actionRow = button.createActionRow();
      
              message.reply({ components: [actionRow] });
          }
      });
              

Ai Usage

      // Importing the Ai class
      const { Ai } = require('dvo.js');
      
      client.command({
        name: "ai",
        async execute(message) {
              const args = message.content.slice(3).trim().split(/ +/);
              const response = args.join(' ');
              let ai = await Ai({content: response});
              message.reply(ai.choices[0]?.message?.content)
          }
      });
              

Handler

To organize your commands and files, these codes place the commands in their own files.

Create Handler

     
      client.commandHandler("./prefixCommand", client)
      client.slashHandler("./slashCommand", client)
              

Message Command

in ./prefixCommand/info/ping.js.

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

Slash Commands

in ./slashCommand/info/ping.js.

                module.exports = {
                  name: "ping",
                  description: "Get bot ping",
                  async execute(interaction, client) {
                      interaction.reply(`Pong! \`${client.ping}ms\``)
                  }
              }
              
Developed with ❤️ by Quatro Studio