mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
Huge Modification to Code
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
const commando = require('discord.js-commando');
|
||||
|
||||
class ServersCommand extends commando.Command {
|
||||
module.exports = class ServersCommand extends commando.Command {
|
||||
constructor(Client){
|
||||
super(Client, {
|
||||
name: 'servers',
|
||||
name: 'servers',
|
||||
aliases: [
|
||||
'serverlist'
|
||||
],
|
||||
group: 'util',
|
||||
memberName: 'servers',
|
||||
description: "Sends a list of all server names and IDs to the log.",
|
||||
@@ -14,15 +17,12 @@ class ServersCommand extends commando.Command {
|
||||
return this.client.isOwner(msg.author);
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
async run(message) {
|
||||
if(message.channel.type !== 'dm') {
|
||||
if(!message.channel.permissionsFor(this.client.user).hasPermission('SEND_MESSAGES')) return;
|
||||
if(!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGES')) return;
|
||||
if(!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
console.log("[Command] " + message.content);
|
||||
console.log(this.client.guilds.array().length + " Servers: " + this.client.guilds.map(g => g.name + " (" + g.id + ")").join(", "));
|
||||
message.channel.send("Sent the information to the console!");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ServersCommand;
|
||||
};
|
||||
Reference in New Issue
Block a user