Formatting

This commit is contained in:
Daniel Odendahl Jr
2017-03-23 01:35:22 +00:00
parent 72718c7c62
commit 40a4af36c4
109 changed files with 2660 additions and 2505 deletions
+18 -16
View File
@@ -3,7 +3,7 @@ const request = require('superagent');
const config = require('../../config.json');
module.exports = class RinSayCommand extends commando.Command {
constructor(Client){
constructor(Client) {
super(Client, {
name: 'rin',
aliases: [
@@ -15,25 +15,27 @@ module.exports = class RinSayCommand extends commando.Command {
examples: [";rin Hey guys!"]
});
}
hasPermission(msg) {
return this.client.isOwner(msg.author);
}
hasPermission(msg) {
return this.client.isOwner(msg.author);
}
async run(message) {
if(message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log("[Command] " + message.content);
let rinContent = message.content.split(" ").slice(1).join(" ");
request
.post(config.webhook)
.send({ content: rinContent })
.then(function (parsedBody) {
if(message.content.type === 'dm') return;
message.delete();
}).catch(function (err) {
message.channel.send(':x: Error! Message failed to send! Check the logs for details.');
console.log(err);
});
.post(config.webhook)
.send({
content: rinContent
})
.then(function(parsedBody) {
if (message.content.type === 'dm') return;
message.delete();
}).catch(function(err) {
message.channel.send(':x: Error! Message failed to send! Check the logs for details.');
console.log(err);
});
}
};
};