Create hastebin.js

This commit is contained in:
Diwas Atreya
2021-04-25 12:29:55 +05:45
committed by GitHub
parent 6f0e3610bb
commit c7ec8f97fd

View File

@@ -0,0 +1,22 @@
const discord = require("discord.js")
const { RichEmbed } = require("discord.js")
const moment = require("moment")
const hastebin = require('hastebin-gen');
module.exports = {
name: "hastebin",
description: "Get link of Your given Code or Text as Hastebin.",
usage: `hastebin <code/text>`,
category: "utility",
aliases: ["haste"],
run: async (client, message, args) => {
if(!args.join(" ")) return message.channel.send(`Please write a Valid Code or Text.`);
hastebin(args.join(" "), { extension: 'rage' }).then(haste => {
message.channel.send(haste);
}).catch(error => {
message.channel.send(`\`\`\`\n-ERROR-\n\`\`\`${error}`);
});
}
}