mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 15:56:52 +02:00
22 lines
751 B
JavaScript
22 lines
751 B
JavaScript
const { Command } = require('discord.js-commando');
|
|
const puns = require('./puns');
|
|
|
|
module.exports = class RandomPunCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'pun',
|
|
group: 'randomimg',
|
|
memberName: 'pun',
|
|
description: 'Sends a random pun image.'
|
|
});
|
|
}
|
|
|
|
run(message) {
|
|
if (message.channel.type !== 'dm')
|
|
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES'))
|
|
return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
|
const pun = puns[Math.floor(Math.random() * puns.length)];
|
|
return message.channel.send({files: [`./images/Pun${pun}`]});
|
|
}
|
|
};
|