Advertisement
gaber-elsayed

quran bot

Sep 18th, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const { prefix, token } = require("./config.json");
  3. const client = new Discord.Client();
  4. const http = require('http');
  5. const server = http.createServer((req, res) => {
  6. res.writeHead(200);
  7. res.end('ok tyizo !');
  8. });
  9. server.listen(4000);
  10. client.once("ready", () => {
  11. const channel = client.channels.cache.get("861872417504231454");
  12. if (!channel) return console.error("The channel does not exist!");
  13. channel
  14. .join()
  15. .then((connection) => {
  16. const play = () => {
  17. const { dispatcher } = connection
  18. .play("./quran.mp3")
  19. .on("finish", play);
  20. };
  21. console.log("Successfully connected.");
  22. play();
  23. })
  24. .catch((e) => {
  25. console.error(e);
  26. });
  27. console.log("Ready!");
  28. });
  29.  
  30. client.on("message", (message) => {
  31. if (!message.content.startsWith(prefix) || message.author.bot) return;
  32. const args = message.content.slice(prefix.length).trim().split(/ +/);
  33. const command = args.shift().toLowerCase();
  34. });
  35.  
  36. client.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement