EnragedPvP

Untitled

Feb 2nd, 2021
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 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. message.channel.send('**-purge**= ``Yeets messages into another dimension`` **Moderator Only**');
  48. }
  49. if (command === 'purge') {
  50. module.exports.run = async (client, message, args) => {
  51. if (message.member.hasPermission("MANAGE_MESSAGES")) {
  52. const deleteCount = await parseInt(args[0]);
  53.  
  54. if (!deleteCount || deleteCount < 1 || deleteCount > 100) {
  55. return await message.channel.send({
  56. embed: {
  57. color: 16734039,
  58. description: "Provide a number between 1 and 100!"
  59. }
  60. })
  61. }
  62.  
  63. message.channel.fetchMessages({ limit: deleteCount })
  64. .then(function (list) {
  65. message.channel.bulkDelete(list);
  66. message.channel.send({
  67. embed: {
  68. color: 16734039,
  69. description: deleteCount + " messages yeeted into another dimension! :white_check_mark:"
  70. }
  71. }).then(msg => msg.delete(2000));
  72. }, function (err) {
  73. message.channel.send({
  74. embed: {
  75. color: 16734039,
  76. description: "ERROR: " + err
  77. }
  78. })
  79. })
  80. } else {
  81. message.channel.send({
  82. embed: {
  83. color: 16734039,
  84. description: "You don't have premission to purge!"
  85. }
  86.  
  87.  
  88.  
  89.  
  90.  
  91. })
  92. }
  93. }
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103. }
  104. }
  105. })
  106.  
Advertisement
Add Comment
Please, Sign In to add comment