mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 08:19:08 +02:00
chance, remove timer, avatar is a link again
This commit is contained in:
@@ -181,6 +181,7 @@ served over 10,000 servers with a uniquely devoted fanbase.
|
||||
* **battle**: Engage in a turn-based battle against another user or the AI.
|
||||
* **captcha-quiz**: Try to guess what the captcha says.
|
||||
* **cards-against-humanity**: Compete to see who can come up with the best card to fill in the blank.
|
||||
* **chance**: Attempt to win with a 1 in 1000 (or your choice) chance of winning.
|
||||
* **emoji-emoji-revolution**: Can you type arrow emoji faster than anyone else has ever typed them before?
|
||||
* **fishy**: Go fishing.
|
||||
* **google-feud**: Attempt to determine the top suggestions for a Google search.
|
||||
@@ -326,7 +327,6 @@ served over 10,000 servers with a uniquely devoted fanbase.
|
||||
* **cleverbot**: Chat with Cleverbot.
|
||||
* **prune**: Deletes up to 99 messages from the current channel.
|
||||
* **strawpoll**: Generates a Strawpoll with the options you provide.
|
||||
* **timer**: Sets a timer for a certain amount of time.
|
||||
|
||||
### Roleplay:
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class GenderGuessCommand extends Command {
|
||||
module.exports = class GenderAnalyzeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'gender-guess',
|
||||
aliases: ['gender', 'guess-gender', 'analyze-gender', 'gender-analyze'],
|
||||
name: 'gender-analyze',
|
||||
aliases: ['gender', 'guess-gender', 'analyze-gender', 'gender-guess'],
|
||||
group: 'analyze',
|
||||
memberName: 'gender',
|
||||
description: 'Determines the gender of a name.',
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
|
||||
module.exports = class ChanceCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'chance',
|
||||
aliases: ['1-in', 'one-in', 'lottery-classic'],
|
||||
group: 'games',
|
||||
memberName: 'chance',
|
||||
description: 'Attempt to win with a 1 in 1000 (or your choice) chance of winning.',
|
||||
args: [
|
||||
{
|
||||
key: 'chance',
|
||||
prompt: 'What is the chance of winning? 1 in what?',
|
||||
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.');
|
||||
}
|
||||
};
|
||||
+2
-10
@@ -1,5 +1,4 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class AvatarCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -9,7 +8,6 @@ module.exports = class AvatarCommand extends Command {
|
||||
group: 'info',
|
||||
memberName: 'avatar',
|
||||
description: 'Responds with a user\'s avatar.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -21,14 +19,8 @@ module.exports = class AvatarCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { user }) {
|
||||
run(msg, { user }) {
|
||||
const format = user.avatar && user.avatar.startsWith('a_') ? 'gif' : 'png';
|
||||
const avatarURL = user.displayAvatarURL({ format, size: 512 });
|
||||
try {
|
||||
const { body } = await snekfetch.get(avatarURL);
|
||||
return msg.say({ files: [{ attachment: body, name: `avatar.${format}` }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
return msg.say(user.displayAvatarURL({ format, size: 2048 }));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { wait } = require('../../util/Util');
|
||||
|
||||
module.exports = class TimerCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'timer',
|
||||
group: 'other',
|
||||
memberName: 'timer',
|
||||
description: 'Sets a timer for a certain amount of time.',
|
||||
args: [
|
||||
{
|
||||
key: 'seconds',
|
||||
prompt: 'How many seconds do you want to set a timer for?',
|
||||
type: 'float',
|
||||
min: 1,
|
||||
max: 600
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
this.timers = new Set();
|
||||
}
|
||||
|
||||
async run(msg, { seconds }) {
|
||||
if (this.timers.has(msg.author.id)) return msg.reply('You can only have one timer at a time.');
|
||||
this.timers.add(msg.author.id);
|
||||
await msg.say(`Setting a timer for ${seconds} seconds...`);
|
||||
await wait(seconds * 1000);
|
||||
this.timers.delete(msg.author.id);
|
||||
return msg.reply('Time\'s up!');
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "67.1.1",
|
||||
"version": "68.0.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user