mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-14 00:08:06 +02:00
Formatting
This commit is contained in:
+18
-16
@@ -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);
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user