Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f23e8f23d | ||
|
|
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}`
|
||||
);
|
||||
|
||||
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
|
||||
|
||||
@@ -36,10 +36,11 @@ function getWelcomeThumbnail(client, member, iconCfg) {
|
||||
|
||||
function buildModernComponents(client, member) {
|
||||
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(
|
||||
new TextDisplayBuilder().setContent(
|
||||
msgconfig.Welcome.Modern.Title.replace(/%joined_user%/g, member.user)
|
||||
|
||||
@@ -74,7 +74,7 @@ Released under the [MIT](https://opensource.org/licenses/MIT) license.
|
||||
|
||||
- [Official addons repository](https://github.com/Emerald-Services/Addons/)
|
||||
- [Syphers Addons](https://github.com/SypherRed/SB_Addons_Unofficial)
|
||||
- [BuiltByBit](https://builtbybit.com/supportbot)
|
||||
- [BuiltByBit]([https://builtbybit.com/supportbot](https://builtbybit.com/resources/supportbot-advanced-ticket-bot.8940/))
|
||||
- [Polymart](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518)
|
||||
|
||||
|
||||
|
||||
@@ -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