Bot-Discord-V13

Como Hacer Un Bot En La V13 Discord.js Requerimos: node.js v16 | Bot-Tutoriales-V13

View on GitHub

Bot Discord V13 ❤

Instalación

Se requiere Node.JS v16.6.1 o más reciente

Primero Es El Package que es este uwu:

PACKAGE

{
  "name": "discord-botv13",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "asynckit": "^0.4.0",
    "callsites": "^3.1.0",
    "combined-stream": "^1.0.8",
    "delayed-stream": "^1.0.0",
    "discord-api-types": "^0.22.0",
    "discord.js": "^13.1.0",
    "dot-prop": "^6.0.1",
    "fs": "^0.0.1-security",
    "is-obj": "^2.0.0",
    "lodash.isequal": "^4.5.0",
    "mime-db": "^1.49.0",
    "mime-types": "^2.1.32",
    "node-fetch": "^2.6.1",
    "ow": "^0.27.0",
    "ts-mixer": "^6.0.0",
    "tslib": "^2.3.1",
    "type-fest": "^1.4.0",
    "vali-date": "^1.0.0",
    "ws": "^7.5.3"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}



Despues de Esto Pones "npm init -y"
y lo ultimo:
npm install

Para Instalar Los Npms!

Despues Debes Irte Donde el archivo config.json y Pones esto!

  {
    "token": "Tu Token - Aqui Lo Podes Copiar Tu Token: https://discord.com/developers/applications/clientid/bot",
    "prefix": "Tu Prefix"
  }

Ejemplos

npm install discord.js Package Aqui: Click Aqui- lo definimos abajo esta para hacer el bot 😅

DISCORD.JS

const Discord = require('discord.js')
const client = new Client({intents: 1}) //Si quieres poner otros intents es aqui: https://ziad87.net/intents/
const { token, prefix } = require('./config.json') //En Replit Debes Crear Un Secret y definilo asi: const token = process.env['token'] y para el prefix: const prefix = "tu prefix"
//mas Informacion: https://github.com/Lovebott/Bot-Discord-V13#env-en-replit

function presence(){
   client.user.setPresence({
      status: "online",
      game: {
         name: "TEXTO", // Mensaje Para Poner en el Estado!
         type: "PLAYING" // PLAYING, WATCHING, LISTENING, STREAMING Nota: Para El STREAMING Debes Poner Asi:
         //type: "STREAMING",
         //url: "twitch canal!" uwu!
      }
   });
}

//    const array = [
//      {
//        name: "Status Text 1",
//        type: "PLAYING",
//      },
//      {
//        name: "Status Text 2",
//        type: "WATCHING",
//      },
//      {
//        name: "Status Text 3",
//        type: "LISTENING",
//      },
//      {
//        name: "Status Text 4",
//        type: "COMPETING",
//      },
//      {
//        name: "Status Text 5",
//        type: "STREAMING",
//        url: "url de twitch!",
//      },
//    ];

//setInterval(() => {
//  function presence() {
//    client.user.setPresence({
//      status: "online",//dnd, idle, invisible, online
//      activities: [array[Math.floor(Math.random() * array.length)]],
//    });
//  }
//}, 1000)


client.on("ready", () => {
    console.log("Estoy listo!");
    presence();
 });
 
client.on("messageCreate", async message => {
    if(message.author.bot) return;
    if(message.content.indexOf(prefix) !==0) return;

    const args = message.content.slice(prefix.length).trim().split(/ +/g);

    const command = args.shift().toLowerCase();

    if(command === 'ping') {

        message.reply("Pong")

    }
   });
 

 
 client.login(token); //No Hacer C&P(Copy and Paste) por que esto puede tener errores ❌

⁉ No Sabes Como Copiar Tu Token? Sencillo Aqui Lo Podes Ver uwu:

Mas Informacion: [Click Aqui](https://github.com/Lovebott/Bot-Discord-V13#-ejecuta-el-proyecto-en)