Advertisement
ELpuripro525

Untitled

Jan 24th, 2022 (edited)
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Comandos CMD.
  2.  
  3. npm i discord.js@12.5.3
  4. npm init -y
  5.  
  6.  
  7.  
  8. Código Iniciar.
  9.  
  10. const Discord = require('discord.js');
  11. const client = new Discord.Client();
  12.  
  13. client.on('ready', () => {
  14. console.log(`Bot Iniciado Correctamente.`);
  15. });
  16.  
  17.  
  18. client.login(' ');
  19.  
  20.  
  21.  
  22.  
  23.  
  24. Codigo Mensaje.
  25.  
  26. client.on("message", (message) => {
  27. if (message.content.startsWith(" ")) {
  28. message.channel.send(" ");
  29. }
  30. });
  31.  
  32.  
  33. Código comando say.
  34.  
  35.  
  36.  
  37.  
  38. client.on("message", message => {
  39. if(message.content.startsWith("say")){
  40. if(!message.member.hasPermission("ADMINISTRATOR")){
  41. return message.channel.send("No tienes permisos para ejecutar este comando");
  42. }
  43. let texto = message.content.slice(8);
  44. if(texto.startsWith(" ")){
  45. texto = texto.slice(1);
  46. }
  47. console.log(texto);
  48. message.channel.send(texto);
  49.  
  50. }
  51. });
  52.  
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement