nyx/command/Utilities/codebin.js

18 lines
589 B
JavaScript
Raw Permalink Normal View History

2023-04-18 11:47:47 +02:00
const CodeClient = require("../../client/CodeClient");
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 });
}
},
};