Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const bot = new Discord.Client();
- const fs = require('fs');
- const prefix = '-';
- bot.command = new Discord.Collection();
- const commandfiles = fs.readdirSync('./command/').filter(file => file.endsWith('.js'));
- for (const file of commandfiles) {
- const command = require(`./command/${file}`);
- bot.command.set(command.name, command);
- }
- bot.on('ready', () => {
- console.log('bot is ready');
- });
- bot.on('message', async function (message) {
- if (!message.content.startsWith(prefix) || message.author.bot)
- return;
- const args = message.content.slice(prefix.length).split(/ +/);
- const command = args.shift().toLowerCase();
- if (command === 'wipe') {
- message.channel.send('Journey Begins with OPEN BETA this FRIDAY Feb 5th 2021');
- } if (command === 'vote') {
- 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');
- message.channel.send('Island=https://ark-servers.net/server/260594/',
- message.channel.send('Aberration=https://ark-servers.net/server/260596/',
- message.channel.send('Center=https://ark-servers.net/server/260595/',
- message.channel.send('Extinction=https://ark-servers.net/server/260597/',
- message.channel.send('Genesis=https://ark-servers.net/server/260598/',
- message.channel.send('Crystal Isles=https://ark-servers.net/server/260599/',
- message.channel.send('Ragnarok=https://ark-servers.net/server/260600/',
- message.channel.send('Valguero=https://ark-servers.net/server/260601/'))))))));
- } if (command === 'commands') {
- message.channel.send('The Commands for this server are as follows: (Make sure to use the prefix - )'); {
- message.channel.send('**-wipe**= ``lets you know when the next wipe day is``');
- message.channel.send('**-vote**= ``gives you voting links for ark-servers.net so you can help our server grow up the ranks!``');
- message.channel.send('**-commands**= ``Gives you a commands list``');
- message.channel.send('**purge**+ ``Yeets messages into another dimension'' **only if you have moderation powers**')
- }
- if (command === 'purge') { }
- module.exports.run = async (client, message, args) => {
- if (message.member.hasPermission("MANAGE_MESSAGES")) {
- const deleteCount = await parseInt(args[0]);
- if (!deleteCount || deleteCount < 1 || deleteCount > 100) {
- return await message.channel.send({
- embed: {
- color: 16734039,
- description: "Provide a number between 1 and 100!"
- }
- })
- }
- message.channel.fetchMessages({ limit: deleteCount })
- .then(function (list) {
- message.channel.bulkDelete(list);
- message.channel.send({
- embed: {
- color: 16734039,
- description: deleteCount + " messages yeeted into another dimension! :white_check_mark:"
- }
- }).then(msg => msg.delete(2000));
- }, function (err) {
- message.channel.send({
- embed: {
- color: 16734039,
- description: "ERROR: " + err
- }
- })
- })
- } else {
- message.channel.send({
- embed: {
- color: 16734039,
- description: "You don't have premission to purge!"
- }
- })
- }
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment