mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
26 lines
988 B
JavaScript
26 lines
988 B
JavaScript
const commando = require('discord.js-commando');
|
|
|
|
class RateWaifuCommand extends commando.Command {
|
|
constructor(Client){
|
|
super(Client, {
|
|
name: 'ratewaifu',
|
|
group: 'response',
|
|
memberName: 'ratewaifu',
|
|
description: 'Rates your Waifu. (;ratewaifu Xiao Pai)',
|
|
examples: [';ratewaifu Xiao Pai']
|
|
});
|
|
}
|
|
|
|
async run(message, args) {
|
|
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;
|
|
}
|
|
console.log("[Command] " + message.content);
|
|
let username = message.content.split(" ").slice(1).join(" ");
|
|
let percentage = Math.floor(Math.random() * 10) + 1;
|
|
message.channel.send("I'd give " + username + " a " + percentage + "/10!");
|
|
}
|
|
}
|
|
|
|
module.exports = RateWaifuCommand; |