mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-09 18:39:35 +02:00
msg
This commit is contained in:
@@ -25,9 +25,9 @@ module.exports = class ClearSettingCommand extends Command {
|
||||
return msg.member.permissions.has('ADMINISTRATOR');
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { setting } = args;
|
||||
message.guild.settings.remove(setting);
|
||||
return message.say(`${setting} has been removed from your guild settings.`);
|
||||
msg.guild.settings.remove(setting);
|
||||
return msg.say(`${setting} has been removed from your guild settings.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,10 +17,10 @@ module.exports = class InfoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const guilds = await this.client.shard.fetchClientValues('guilds.size');
|
||||
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
|
||||
const embed = new RichEmbed()
|
||||
@@ -48,6 +48,6 @@ module.exports = class InfoCommand extends Command {
|
||||
'[commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://github.com/visionmedia/superagent), [mathjs](http://mathjs.org/), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org/), [sequelize](http://docs.sequelizejs.com/en/v3/), [pg](https://github.com/brianc/node-postgres)')
|
||||
.addField('APIs',
|
||||
'[Wattpad](https://developer.wattpad.com/docs/api), [Wordnik](http://developer.wordnik.com/docs.html), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link/), [Yugioh Prices](http://docs.yugiohprices.apiary.io/#), [YouTube Data](https://developers.google.com/youtube/v3/), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io/), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com/), [Yahoo Weather](https://developer.yahoo.com/weather/), [Wikipedia](https://en.wikipedia.org/w/api.php), [Google Static Maps](https://developers.google.com/maps/documentation/static-maps/), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [rrrather](http://www.rrrather.com/botapi), [SoundCloud](https://developers.soundcloud.com/), [random.cat](http://random.cat/), [random.dog](https://random.dog/)');
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,8 +10,8 @@ module.exports = class InviteCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
async run(msg) {
|
||||
const invite = await this.client.generateInvite('1345846343');
|
||||
return message.say(`Add me to your server with this link:\n${invite}\nOr, come to my server with this link:\n${this.client.options.invite}`);
|
||||
return msg.say(`Add me to your server with this link:\n${invite}\nOr, come to my server with this link:\n${this.client.options.invite}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,9 +20,9 @@ module.exports = class MemberLogCommand extends Command {
|
||||
return msg.member.permissions.has('ADMINISTRATOR');
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { channel } = args;
|
||||
message.guild.settings.set('memberLog', channel.name);
|
||||
return message.say(`Member Log channel set to ${channel.name}.`);
|
||||
msg.guild.settings.set('memberLog', channel.name);
|
||||
return msg.say(`Member Log channel set to ${channel.name}.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,9 +20,9 @@ module.exports = class ModChannelCommand extends Command {
|
||||
return msg.member.permissions.has('ADMINISTRATOR');
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { channel } = args;
|
||||
message.guild.settings.set('modLog', channel.name);
|
||||
return message.say(`Mod Log channel set to ${channel.name}.`);
|
||||
msg.guild.settings.set('modLog', channel.name);
|
||||
return msg.say(`Mod Log channel set to ${channel.name}.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,13 +22,13 @@ module.exports = class ShardInfoCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return message.say('This Command requires the `Embed Links` Permission.');
|
||||
async run(msg, args) {
|
||||
if (msg.channel.type !== 'dm')
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { shard } = args;
|
||||
if (shard > this.client.options.shardCount - 1 || shard < 0)
|
||||
return message.say('The Shard ID is not valid.');
|
||||
return msg.say('The Shard ID is not valid.');
|
||||
const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)');
|
||||
const uptime = await this.client.shard.fetchClientValues('uptime');
|
||||
const guilds = await this.client.shard.fetchClientValues('guilds.size');
|
||||
@@ -41,6 +41,6 @@ module.exports = class ShardInfoCommand extends Command {
|
||||
`${memory[shard]}MB`, true)
|
||||
.addField('Uptime',
|
||||
moment.duration(uptime[shard]).format('d[d]h[h]m[m]s[s]'), true);
|
||||
return message.embed(embed);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,9 +20,9 @@ module.exports = class StaffRoleCommand extends Command {
|
||||
return msg.member.permissions.has('ADMINISTRATOR');
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
run(msg, args) {
|
||||
const { role } = args;
|
||||
message.guild.settings.set('staffRole', role.name);
|
||||
return message.say(`Server Staff role set to ${role.name}.`);
|
||||
msg.guild.settings.set('staffRole', role.name);
|
||||
return msg.say(`Server Staff role set to ${role.name}.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ module.exports = class UptimeCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
return message.say(`I've been active on this shard for: **${moment.duration(this.client.uptime).format('d[ days], h[ hours], m[ minutes, and ]s[ seconds]')}**!`);
|
||||
run(msg) {
|
||||
return msg.say(`I've been active on this shard for: **${moment.duration(this.client.uptime).format('d[ days], h[ hours], m[ minutes, and ]s[ seconds]')}**!`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user