Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c07b8a236 | ||
|
|
571bd586fa | ||
|
|
eac2d88873 | ||
|
|
93c793f393 | ||
|
|
1aa97b63f9 |
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}`
|
`**Reason:**\n ${TicketReason}`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (supportbot.Ticket.TicketReason && TicketReason) {
|
||||||
|
ticketMsgContainer.addTextDisplayComponents(ticketReason)
|
||||||
|
}
|
||||||
|
|
||||||
const selectMenuRow = new ActionRowBuilder();
|
const selectMenuRow = new ActionRowBuilder();
|
||||||
|
|
||||||
const SelectMenus = new StringSelectMenuBuilder()
|
const SelectMenus = new StringSelectMenuBuilder()
|
||||||
@@ -561,10 +565,6 @@ module.exports = new Command({
|
|||||||
|
|
||||||
ticketMsgContainer.addActionRowComponents(selectMenuRow)
|
ticketMsgContainer.addActionRowComponents(selectMenuRow)
|
||||||
|
|
||||||
if (supportbot.Ticket.TicketReason && TicketReason) {
|
|
||||||
ticketMsgContainer.addTextDisplayComponents(ticketReason)
|
|
||||||
}
|
|
||||||
|
|
||||||
await ticketChannel.send({
|
await ticketChannel.send({
|
||||||
flags: MessageFlags.IsComponentsV2,
|
flags: MessageFlags.IsComponentsV2,
|
||||||
components: [ticketMsgContainer],
|
components: [ticketMsgContainer],
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#
|
#
|
||||||
# SupportBot Configuration (supportbot.yml)
|
# SupportBot Configuration (supportbot.yml)
|
||||||
|
|
||||||
SupportBot_Version: "v8.4"
|
SupportBot_Version: "v8.4.1"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# General
|
# General
|
||||||
|
|||||||
@@ -36,10 +36,11 @@ function getWelcomeThumbnail(client, member, iconCfg) {
|
|||||||
|
|
||||||
function buildModernComponents(client, member) {
|
function buildModernComponents(client, member) {
|
||||||
const container = new ContainerBuilder()
|
const container = new ContainerBuilder()
|
||||||
.setAccentColor(
|
|
||||||
parseInt(msgconfig.Welcome.Modern.Colour.replace("#", ""), 16)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
if (msgconfig.Welcome.Modern.Colour) {
|
||||||
|
container .setAccentColor(parseInt(msgconfig.Welcome.Modern.Colour.replace("#", ""), 16));
|
||||||
|
}
|
||||||
|
|
||||||
const section = new SectionBuilder().addTextDisplayComponents(
|
const section = new SectionBuilder().addTextDisplayComponents(
|
||||||
new TextDisplayBuilder().setContent(
|
new TextDisplayBuilder().setContent(
|
||||||
msgconfig.Welcome.Modern.Title.replace(/%joined_user%/g, member.user)
|
msgconfig.Welcome.Modern.Title.replace(/%joined_user%/g, member.user)
|
||||||
|
|||||||
@@ -41,26 +41,26 @@ logTypes.forEach((type) => {
|
|||||||
|
|
||||||
function logToFile(type, data) {
|
function logToFile(type, data) {
|
||||||
const date = new Date().toISOString().split("T")[0];
|
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`);
|
fs.appendFileSync(file, `[${new Date().toISOString()}] ${data}\n`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const origLog = console.log;
|
const origLog = console.log;
|
||||||
console.log = (...args) => {
|
console.log = (...args) => {
|
||||||
origLog(...args);
|
origLog(...args);
|
||||||
logToFile("output", args.join(" "));
|
logToFile("Output", args.join(" "));
|
||||||
};
|
};
|
||||||
|
|
||||||
const origWarn = console.warn;
|
const origWarn = console.warn;
|
||||||
console.warn = (...args) => {
|
console.warn = (...args) => {
|
||||||
origWarn(...args);
|
origWarn(...args);
|
||||||
logToFile("warn", args.join(" "));
|
logToFile("Warn", args.join(" "));
|
||||||
};
|
};
|
||||||
|
|
||||||
const origError = console.error;
|
const origError = console.error;
|
||||||
console.error = (...args) => {
|
console.error = (...args) => {
|
||||||
origError(...args);
|
origError(...args);
|
||||||
logToFile("error", args.join(" "));
|
logToFile("Error", args.join(" "));
|
||||||
};
|
};
|
||||||
|
|
||||||
process.on("unhandledRejection", (reason) => {
|
process.on("unhandledRejection", (reason) => {
|
||||||
|
|||||||
Reference in new issue
Block a user