mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-09 01:04:16 +02:00
More uniform group names
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class CreateQRCodeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'create-qr-code',
|
||||
aliases: ['create-qr'],
|
||||
group: 'edit-image',
|
||||
memberName: 'create-qr-code',
|
||||
description: 'Converts text to a QR Code.',
|
||||
credit: [
|
||||
{
|
||||
name: 'goQR.me',
|
||||
url: 'http://goqr.me/',
|
||||
reason: 'QR code API',
|
||||
reasonURL: 'http://goqr.me/api/'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like to convert to a QR Code?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { text }) {
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('https://api.qrserver.com/v1/create-qr-code/')
|
||||
.query({ data: text });
|
||||
return msg.say({ files: [{ attachment: body, name: 'qr-code.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user