forked from cosmic-jellyfish/PeepoBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sniper.js
40 lines (29 loc) · 1.03 KB
/
sniper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Command: $sniper
* Author: Cake#0002
* Description: Some sniper scope with avatar
*/
const Discord = require('discord.js');
const { Attachment } = require("discord.js");
const Idiot = require("idiotic-api");
exports.exec = async (client, message, args, API, user) => {
client.API = new Idiot.Client("xxxxxxxxxxxxxx", { dev: true });
// Fires Error message that the command wasn't ran correctly.
if (args == '') {
return client.emit('commandUsage', message, this.help);
}
// Fires Error message that the command wasn't ran correctly.
let url = message.author.displayAvatarURL;
if (message.mentions.users.first()) {
url = message.mentions.users.first().displayAvatarURL;
}
message.channel.send('`Processing image`.')
.then(msg => {
msg.delete(5000)
})
message.channel.startTyping();
let bs = await client.API.sniper(url);
await message.channel.stopTyping();
return message.channel.send({ files: [{ attachment: bs }] });
};
/* * * * */