Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Comandos CMD.
- npm i discord.js@12.5.3
- npm init -y
- Código Iniciar.
- const Discord = require('discord.js');
- const client = new Discord.Client();
- client.on('ready', () => {
- console.log(`Bot Iniciado Correctamente.`);
- });
- client.login(' ');
- Codigo Mensaje.
- client.on("message", (message) => {
- if (message.content.startsWith(" ")) {
- message.channel.send(" ");
- }
- });
- Código comando say.
- client.on("message", message => {
- if(message.content.startsWith("say")){
- if(!message.member.hasPermission("ADMINISTRATOR")){
- return message.channel.send("No tienes permisos para ejecutar este comando");
- }
- let texto = message.content.slice(8);
- if(texto.startsWith(" ")){
- texto = texto.slice(1);
- }
- console.log(texto);
- message.channel.send(texto);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement