2022-01-08 01:07:13 +01:00
|
|
|
const CodeClient = require("../../../client/CodeClient");
|
2021-11-18 18:56:42 +01:00
|
|
|
module.exports = {
|
|
|
|
name: "Create Code Bin",
|
|
|
|
type: "MESSAGE",
|
|
|
|
run: async (client, interaction) => {
|
|
|
|
const msg = await interaction.channel.messages.fetch(interaction.targetId);
|
|
|
|
if (!msg.content) {
|
|
|
|
interaction.followUp({ content: "The message must have a content" });
|
|
|
|
} else {
|
|
|
|
const title = "Code";
|
|
|
|
const description = msg.author.tag;
|
|
|
|
const code = msg.content;
|
|
|
|
const link = await CodeClient.createBin(title, description, code);
|
|
|
|
interaction.followUp({ content: link });
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|