Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.message = message => {
- const split = message.cleanContent.split(" "),
- command = split[0];
- if (message.channel.type == "dm") return;
- if (command == "-gen") {
- if(message.author.id === "11"){
- return message.author.send("You have been banned from using VocGen. Pm gz#8851 with why you want to be unbanned.");
- }
- message.delete().catch(err => undefined);
- if (!split[1]) return post(message, "You must provide a category!");
- const category = database.get(split[1].toLowerCase(), true);
- if (!category) return post(message, "Category Does Not Exist");
- if (category.data.length == 0) return post(message, "Category Empty");
- const cdi = handler.cooldown.findIndex(x => x.id == message.author.id);
- if (cdi != -1) return post(message, `Please wait **${Math.abs(Math.floor(60 - ((new Date().getTime() - handler.cooldown[cdi].time.getTime()) / 1000)))}s** before using that again!`);
- const new_index = handler.cooldown.push({id: message.author.id, time: new Date()});
- const to_splice = handler.cooldown[new_index];
- setTimeout(() => handler.cooldown.splice(handler.cooldown.indexOf(to_splice), 1), 60000);
- const data = database.pull(split[1].toLowerCase());
- database.save();
- post(message, "Generating...");
- clicksify(data).then(response => {
- response = JSON.parse(response);
- if (response.status != 'success') return post(message, "There was an issue grabbing the account...");
- const embed = generate(message, `Your ${category.name} account data is available [**HERE**](${data})`);
- message.member.send(embed).then(linked => {
- const post = message.channel.send;
- message.channel.send(`Your ${category.name} account data is available [**HERE**](${linked.url})`)
- .then(msg => {
- msg.delete(30000)
- })
- console.log(`${message.author.tag} has generated an account with the category ${category.name}`);
- const log = new Discord.RichEmbed();
- log.setFooter(message.author.tag, message.author.avatarURL || message.author.defaultAvatarURL);
- log.setTitle("Account Generated");
- log.addField("Category", category.name[0].toUpperCase() + category.name.substring(1), true);
- log.addField("Server", message.member.guild.name, true);
- log.setColor("#36393F");
- const log_channel = client.channels.get('588585916642099210');
- if (log_channel) log_channel.send(log);
- }).catch(() => undefined);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement