mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Osu Signature
This commit is contained in:
@@ -5,6 +5,3 @@ package-lock.json
|
||||
# Logs
|
||||
logs/
|
||||
*.log
|
||||
|
||||
# Unfinished Commands
|
||||
commands/games/tricks.js
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"red": "hexee3333",
|
||||
"orange": "hexee8833",
|
||||
"yellow": "hexffcc22",
|
||||
"green": "hexaadd00",
|
||||
"blue": "hex66ccff",
|
||||
"purple": "hex8866ee",
|
||||
"pink": "hexff66aa",
|
||||
"dark blue": "hex2255ee",
|
||||
"dark pink": "pink",
|
||||
"black": "hex000000"
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const snekfetch = require('snekfetch');
|
||||
const { list } = require('../../util/Util');
|
||||
const colors = require('../../assets/json/osu-signature');
|
||||
|
||||
module.exports = class OsuSignatureCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'osu-signature',
|
||||
aliases: ['osu-sig', 'osu-card'],
|
||||
group: 'image-edit',
|
||||
memberName: 'osu-signature',
|
||||
description: 'Creates a card based on an osu! user\'s stats.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
prompt: 'What user would you like to create a signature for?',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
key: 'color',
|
||||
prompt: `What color should the signature be? Either ${list(Object.keys(colors), 'or')}.`,
|
||||
type: 'string',
|
||||
default: 'pink',
|
||||
validate: color => {
|
||||
if (colors[color.toLowerCase()]) return true;
|
||||
return `Invalid color, please enter either ${list(Object.keys(colors), 'or')}.`;
|
||||
},
|
||||
parse: color => colors[color.toLowerCase()]
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { user, color }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('https://lemmmy.pw/osusig/sig.php')
|
||||
.query({
|
||||
colour: color,
|
||||
uname: user,
|
||||
pp: 2,
|
||||
flagshadow: '',
|
||||
flagstroke: '',
|
||||
darktriangles: '',
|
||||
opaqueavatar: '',
|
||||
onlineindicator: '',
|
||||
xpbar: ''
|
||||
});
|
||||
return msg.say({ files: [{ attachment: body, name: 'osu-signature.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "62.0.0",
|
||||
"version": "62.1.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user