mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 14:55:40 +02:00
Reaction Time and Snapcode Commands
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class SnapcodeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'snapcode',
|
||||
aliases: ['snapchat'],
|
||||
group: 'edit-image',
|
||||
memberName: 'snapcode',
|
||||
description: 'Responds with the Snapcode of a Snapchat user.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
credit: [
|
||||
{
|
||||
name: 'Snapchat',
|
||||
url: 'https://www.snapchat.com/',
|
||||
reason: 'API'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'username',
|
||||
prompt: 'What user do you want to get the Snapcode for?',
|
||||
type: 'string'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { username }) {
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('https://feelinsonice.appspot.com/web/deeplink/snapcode')
|
||||
.query({
|
||||
username,
|
||||
type: 'PNG',
|
||||
size: 320
|
||||
});
|
||||
return msg.say({ files: [{ attachment: body, name: 'snapcode.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user