Commit a27309e4 authored by Imran Hussain's avatar Imran Hussain
Browse files

Run all code through a linter and pass `npm run test`

parent d6dcc8e0
Pipeline #635 passed with stage
in 17 minutes and 17 seconds
module.exports = message => {
const member = message.mentions.members.first();
module.exports = (message) => {
const member = message.mentions.members.first();
if (!member) {
return message.reply(
`Who are you trying to kick? You must mention a user.`
);
}
if (!member) {
return message.reply(
`Who are you trying to kick? You must mention a user.`
);
}
if (!member.kickable) {
return message.reply(`I can't kick this user. Sorry!`);
}
if (!member.kickable) {
return message.reply(`I can't kick this user. Sorry!`);
}
return member
.kick()
.then(() => message.reply(`${member.user.tag} was kicked.`))
.catch(error => message.reply(`Sorry, an error occured.`));
return member
.kick()
.then(() => message.reply(`${member.user.tag} was kicked.`))
.catch((error) => message.reply(`Sorry, an error occured.`));
};
module.exports = (client, member) => {
member.send(
`Welcome on the server!`
);
};
\ No newline at end of file
member.send(
`Welcome on the server!`
);
};
const kick = require("../commands/kick");
const kick = require('../commands/kick');
module.exports = (client, message) => {
if (message.content.startsWith(".kick")) {
return kick(message);
}
if (message.content.startsWith(".e")) {
message.reply(`This is not MW!`);
}
};
\ No newline at end of file
if (message.content.startsWith('.kick')) {
return kick(message);
}
if (message.content.startsWith('.e')) {
message.reply(`This is not MW!`);
}
};
module.exports = client => {
console.log(`Logged in as ${client.user.tag}!`);
};
\ No newline at end of file
module.exports = (client) => {
console.log(`Logged in as ${client.user.tag}!`);
};
require("dotenv").config();
const Discord = require("discord.js");
const fs = require("fs");
require('dotenv').config();
const Discord = require('discord.js');
const fs = require('fs');
const client = new Discord.Client();
//main event handler, look in a folder clled "events" and when one comes in
//that matches use that file
fs.readdir("./events/", (err, files) => {
files.forEach(file => {
const eventHandler = require(`./events/${file}`);
const eventName = file.split(".")[0];
client.on(eventName, (...args) => eventHandler(client, ...args));
});
// main event handler, look in a folder clled "events" and when one comes in
// that matches use that file
fs.readdir('./events/', (err, files) => {
files.forEach((file) => {
const eventHandler = require(`./events/${file}`);
const eventName = file.split('.')[0];
client.on(eventName, (...args) => eventHandler(client, ...args));
});
});
client.login(process.env.BOT_TOKEN);
\ No newline at end of file
client.login(process.env.BOT_TOKEN);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment