mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
26 lines
608 B
JavaScript
26 lines
608 B
JavaScript
const Command = require('../../framework/Command');
|
|
|
|
module.exports = class ChanceCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'chance',
|
|
aliases: ['1-in', 'one-in'],
|
|
group: 'games-sp',
|
|
description: 'Attempt to win with a 1 in 1000 (or your choice) chance of winning.',
|
|
args: [
|
|
{
|
|
key: 'chance',
|
|
type: 'string',
|
|
default: 1000
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, { chance }) {
|
|
const loss = Math.floor(Math.random() * chance);
|
|
if (!loss) return msg.reply('Nice job! 10/10! You deserve some cake!');
|
|
return msg.reply('Nope, sorry, you lost.');
|
|
}
|
|
};
|