4 files changed
+35
-9
No files matched your search
@@ -0,0 +1,26 @@
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const yaml = require("js-yaml");
|
||||
const { Command } = require('../Structures/Addon.js'); // Adjust the path as needed
|
||||
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||
|
||||
module.exports = new Command({
|
||||
name: "addon",
|
||||
description: "This is a sample addon!",
|
||||
options: [],
|
||||
permissions: ["Administrator"],
|
||||
|
||||
async run(interaction) {
|
||||
let disableCommand = true;
|
||||
|
||||
const PingEmbed = new Discord.EmbedBuilder()
|
||||
.setDescription(
|
||||
`This is a sample addon.\n\nPong! \`${interaction.client.ws.ping} ms\``
|
||||
)
|
||||
.setColor(supportbot.Embed.Colours.General);
|
||||
|
||||
interaction.reply({
|
||||
embeds: [PingEmbed],
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -507,6 +507,10 @@ module.exports = new Command({
|
||||
`**Reason:**\n ${TicketReason}`
|
||||
);
|
||||
|
||||
if (supportbot.Ticket.TicketReason && TicketReason) {
|
||||
ticketMsgContainer.addTextDisplayComponents(ticketReason)
|
||||
}
|
||||
|
||||
const selectMenuRow = new ActionRowBuilder();
|
||||
|
||||
const SelectMenus = new StringSelectMenuBuilder()
|
||||
@@ -561,10 +565,6 @@ module.exports = new Command({
|
||||
|
||||
ticketMsgContainer.addActionRowComponents(selectMenuRow)
|
||||
|
||||
if (supportbot.Ticket.TicketReason && TicketReason) {
|
||||
ticketMsgContainer.addTextDisplayComponents(ticketReason)
|
||||
}
|
||||
|
||||
await ticketChannel.send({
|
||||
flags: MessageFlags.IsComponentsV2,
|
||||
components: [ticketMsgContainer],
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# SupportBot Configuration (supportbot.yml)
|
||||
|
||||
SupportBot_Version: "v8.4"
|
||||
SupportBot_Version: "v8.4.1"
|
||||
|
||||
# -------------------------
|
||||
# General
|
||||
|
||||
@@ -41,26 +41,26 @@ logTypes.forEach((type) => {
|
||||
|
||||
function logToFile(type, data) {
|
||||
const date = new Date().toISOString().split("T")[0];
|
||||
const file = path.join(`./logs/${type}`, `${type}-${date}.log`);
|
||||
const file = path.join(`./Logs/${type}`, `${type}-${date}.log`);
|
||||
fs.appendFileSync(file, `[${new Date().toISOString()}] ${data}\n`);
|
||||
}
|
||||
|
||||
const origLog = console.log;
|
||||
console.log = (...args) => {
|
||||
origLog(...args);
|
||||
logToFile("output", args.join(" "));
|
||||
logToFile("Output", args.join(" "));
|
||||
};
|
||||
|
||||
const origWarn = console.warn;
|
||||
console.warn = (...args) => {
|
||||
origWarn(...args);
|
||||
logToFile("warn", args.join(" "));
|
||||
logToFile("Warn", args.join(" "));
|
||||
};
|
||||
|
||||
const origError = console.error;
|
||||
console.error = (...args) => {
|
||||
origError(...args);
|
||||
logToFile("error", args.join(" "));
|
||||
logToFile("Error", args.join(" "));
|
||||
};
|
||||
|
||||
process.on("unhandledRejection", (reason) => {
|
||||
|
||||
Reference in new issue
Block a user