EnragedPvP

Untitled

Feb 2nd, 2021
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. const Discord = require("discord.js");
  2.  
  3. const bot = new Discord.Client();
  4.  
  5. const fs = require('fs');
  6.  
  7. const prefix = '-';
  8.  
  9. bot.command = new Discord.Collection();
  10.  
  11. const commandfiles = fs.readdirSync('./command/').filter(file => file.endsWith('.js'));
  12. for (const file of commandfiles) {
  13. const command = require(`./command/${file}`);
  14.  
  15. bot.command.set(command.name, command);
  16. }
  17.  
  18.  
  19. bot.on('ready', () => {
  20. console.log('bot is ready');
  21. });
  22.  
  23. bot.on('message', async function (message) {
  24. if (!message.content.startsWith(prefix) || message.author.bot)
  25. return;
  26.  
  27. const args = message.content.slice(prefix.length).split(/ +/);
  28. const command = args.shift().toLowerCase();
  29.  
  30. if (command === 'wipe') {
  31. message.channel.send('Journey Begins with OPEN BETA this FRIDAY Feb 5th 2021');
  32. } if (command === 'vote') {
  33. message.channel.send('Down below you will find all the links to our servers so that you can vote! We are currently looking into a way players can receive points upon voting');
  34. message.channel.send('Island=https://ark-servers.net/server/260594/',
  35. message.channel.send('Aberration=https://ark-servers.net/server/260596/',
  36. message.channel.send('Center=https://ark-servers.net/server/260595/',
  37. message.channel.send('Extinction=https://ark-servers.net/server/260597/',
  38. message.channel.send('Genesis=https://ark-servers.net/server/260598/',
  39. message.channel.send('Crystal Isles=https://ark-servers.net/server/260599/',
  40. message.channel.send('Ragnarok=https://ark-servers.net/server/260600/',
  41. message.channel.send('Valguero=https://ark-servers.net/server/260601/'))))))));
  42. } if (command === 'commands') {
  43. message.channel.send('The Commands for this server are as follows: (Make sure to use the prefix - )'); {
  44. message.channel.send('**-wipe**= ``lets you know when the next wipe day is``');
  45. message.channel.send('**-vote**= ``gives you voting links for ark-servers.net so you can help our server grow up the ranks!``');
  46. message.channel.send('**-commands**= ``Gives you a commands list``');
  47. if (command === 'purge')
  48. module.exports = {
  49. name: 'purge',
  50. description: `Deletes amount of messages provided`,
  51. async execute(message, args) {
  52. if (message.member.hasPermission("MANAGE_MESSAGES")) {
  53. const deleteCount = parseInt(args[0], 10)
  54. const deleteMessage = `Deleted ${deleteCount} messages.`;
  55.  
  56. if (!deleteCount || deleteCount < 2 || deleteCount > 100) return message.reply("Please provide a number to delete");
  57.  
  58. const fetched = await message.channel.fetchMessages({
  59. limit: deleteCount
  60. });
  61.  
  62. message.channel.bulkDelete(fetched)
  63. .catch(error => console.log(`Couldn't Delete messages because of, ${error}`))
  64. .then(() => message.channel.send(deleteMessage))
  65. .catch(err => {
  66. console.log(err);
  67. });
  68. } else {
  69. message.reply(`You dont have permission to use this command`);
  70. }
  71. }
  72. }
  73. }
  74. }
  75. })
Advertisement
Add Comment
Please, Sign In to add comment