Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4af9759700 | ||
|
|
835cbbe937 | ||
|
|
491bb9ba65 | ||
|
|
ced29535f9 | ||
|
|
d99e9a105b | ||
|
|
c72c7c5c34 | ||
|
|
23960bc30d | ||
|
|
abb48c281b | ||
|
|
7acb825713 | ||
|
|
dd2f329485 | ||
|
|
75577ec0bd | ||
|
|
7366bcda71 | ||
|
|
23e43cfad3 | ||
|
|
ad9a8085aa | ||
|
|
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],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
// SupportBot | Emerald Services
|
|
||||||
// Info Command
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const { ContainerBuilder, UserSelectMenuBuilder, ButtonStyle, MessageFlags } = require('discord.js');
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
|
|
||||||
const supportbot = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
const cmdconfig = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/commands.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
const msgconfig = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/messages.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
const db = require("../../Structures/Database.js");
|
|
||||||
const Command = require("../../Structures/Command.js");
|
|
||||||
|
|
||||||
module.exports = new Command({
|
|
||||||
name: "test",
|
|
||||||
description: cmdconfig.Info.Description,
|
|
||||||
options: [],
|
|
||||||
permissions: cmdconfig.Info.Permission,
|
|
||||||
|
|
||||||
async run(interaction, client) {
|
|
||||||
|
|
||||||
const ticketPanelembed = new ContainerBuilder()
|
|
||||||
.addTextDisplayComponents(
|
|
||||||
textDisplay => textDisplay
|
|
||||||
.setContent("SupportBot"),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
await interaction.reply({
|
|
||||||
components: [ticketPanelembed],
|
|
||||||
flags: MessageFlags.IsComponentsV2,
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
});
|
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Info Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const {
|
||||||
|
EmbedBuilder,
|
||||||
|
ApplicationCommandOptionType,
|
||||||
|
ApplicationCommandType,
|
||||||
|
ChannelType,
|
||||||
|
ActionRowBuilder,
|
||||||
|
ButtonBuilder,
|
||||||
|
StringSelectMenuBuilder,
|
||||||
|
StringSelectMenuOptionBuilder,
|
||||||
|
ButtonStyle,
|
||||||
|
MessageCollector,
|
||||||
|
MessageFlags,
|
||||||
|
ModalBuilder,
|
||||||
|
TextInputBuilder,
|
||||||
|
TextInputStyle,
|
||||||
|
SeparatorBuilder,
|
||||||
|
ContainerBuilder,
|
||||||
|
TextDisplayBuilder
|
||||||
|
} = require("discord.js");
|
||||||
|
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const msgconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/messages.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const Command = require("../../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.TicketRename.Command,
|
||||||
|
description: cmdconfig.TicketRename.Description,
|
||||||
|
options: [],
|
||||||
|
permissions: cmdconfig.TicketRename.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const modal = new ModalBuilder()
|
||||||
|
.setCustomId("renameTicketModal")
|
||||||
|
.setTitle("Rename Channel")
|
||||||
|
.addComponents(
|
||||||
|
new ActionRowBuilder().addComponents(
|
||||||
|
new TextInputBuilder()
|
||||||
|
.setCustomId("renameTicket")
|
||||||
|
.setLabel("New Channel Name")
|
||||||
|
.setStyle(TextInputStyle.Short)
|
||||||
|
.setRequired(true)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return interaction.showModal(modal);
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -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],
|
||||||
|
|||||||
@@ -37,12 +37,21 @@ Profile:
|
|||||||
Permission: ["SendMessages"]
|
Permission: ["SendMessages"]
|
||||||
# Command is automatically disabled when the TicketClaims is disabled.
|
# Command is automatically disabled when the TicketClaims is disabled.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OpenTicket:
|
OpenTicket:
|
||||||
Command: "ticket"
|
Command: "ticket"
|
||||||
Description: "Create a support ticket."
|
Description: "Create a support ticket."
|
||||||
Permission: ["SendMessages"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
TicketRename:
|
||||||
|
Command: "rename"
|
||||||
|
Description: "Rename a support ticket."
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
|
||||||
AddUser:
|
AddUser:
|
||||||
Command: "add"
|
Command: "add"
|
||||||
Description: "Add a user to a support ticket."
|
Description: "Add a user to a support ticket."
|
||||||
|
|||||||
+29
-30
@@ -13,7 +13,7 @@
|
|||||||
#
|
#
|
||||||
# SupportBot Configuration (supportbot.yml)
|
# SupportBot Configuration (supportbot.yml)
|
||||||
|
|
||||||
SupportBot_Version: "v8.4"
|
SupportBot_Version: "v8.5"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# General
|
# General
|
||||||
@@ -21,7 +21,7 @@ SupportBot_Version: "v8.4"
|
|||||||
|
|
||||||
General:
|
General:
|
||||||
Name: "SupportBot"
|
Name: "SupportBot"
|
||||||
Token: "BOT_TOKEN"
|
Token: "BBOT_TOKEN_HERE"
|
||||||
|
|
||||||
Addons:
|
Addons:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
@@ -66,12 +66,12 @@ Embed:
|
|||||||
Roles:
|
Roles:
|
||||||
AutoRole:
|
AutoRole:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Role: "1111111111111111"
|
Role: "ROLE_ID"
|
||||||
|
|
||||||
StaffMember:
|
StaffMember:
|
||||||
Staff: "1111111111111111"
|
Staff: "ROLE_ID"
|
||||||
Admin: "1111111111111111"
|
Admin: "ROLE_ID"
|
||||||
Moderator: "1111111111111111"
|
Moderator: "ROLE_ID"
|
||||||
|
|
||||||
Mod:
|
Mod:
|
||||||
AllowSupportStaff: false
|
AllowSupportStaff: false
|
||||||
@@ -84,11 +84,11 @@ Roles:
|
|||||||
|
|
||||||
Welcome:
|
Welcome:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Channel: "1111111111111111"
|
Channel: "WELCOME_CHANNEL_ID"
|
||||||
|
|
||||||
Leave:
|
Leave:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Channel: "1111111111111111"
|
Channel: "LEAVE_CHANNEL_ID "
|
||||||
|
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Suggestions
|
# Suggestions
|
||||||
@@ -96,8 +96,8 @@ Leave:
|
|||||||
|
|
||||||
Suggestions:
|
Suggestions:
|
||||||
Mode: "Channel" # Channel or Forum
|
Mode: "Channel" # Channel or Forum
|
||||||
ForumChannel: "1111111111111111"
|
ForumChannel: "FORUM_CHANNEL_ID" # A forum channel, disabled if mode is set to Channel.
|
||||||
Channel: "1111111111111111"
|
Channel: "SUGGESTIONS_CHANNEL_ID" # A text channel, disabled if mode is set to Forum.
|
||||||
|
|
||||||
UpvoteEmoji: "✅"
|
UpvoteEmoji: "✅"
|
||||||
DownvoteEmoji: "❌"
|
DownvoteEmoji: "❌"
|
||||||
@@ -130,10 +130,10 @@ Suggestions:
|
|||||||
# 4 - Red
|
# 4 - Red
|
||||||
|
|
||||||
Tags:
|
Tags:
|
||||||
Created: "1111111111111111"
|
Created: "TAG_ID"
|
||||||
Considering: "1111111111111111"
|
Considering: "TAG_ID"
|
||||||
Solved: "1111111111111111"
|
Solved: "TAG_ID"
|
||||||
Denied: "1111111111111111"
|
Denied: "TAG_ID"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Tickets
|
# Tickets
|
||||||
@@ -141,25 +141,25 @@ Suggestions:
|
|||||||
|
|
||||||
VoiceTickets:
|
VoiceTickets:
|
||||||
Name: "%username%'s VC"
|
Name: "%username%'s VC"
|
||||||
Category: "1111111111111111"
|
Category: "VC_CATEGORY_ID"
|
||||||
|
|
||||||
Ticket:
|
Ticket:
|
||||||
TicketType: "threads"
|
TicketType: "channels"
|
||||||
|
|
||||||
# Available TicketTypes:
|
# Available TicketTypes:
|
||||||
# channels - Tickets will be created as channels in the TicketChannelsCategory
|
# channels - Tickets will be created as channels in the TicketChannelsCategory
|
||||||
# threads - Tickets will be created as threads through the "TicketHome" channel.
|
# threads - Tickets will be created as threads through the "TicketHome" channel.
|
||||||
|
|
||||||
TicketHome: "1111111111111111"
|
TicketHome: "TICKET_HOME_CHANNEL_ID"
|
||||||
|
|
||||||
# What is TicketHome?
|
# What is TicketHome?
|
||||||
# - Channel where the Ticket creation panel is sent.
|
# - Channel where the Ticket creation panel is sent.
|
||||||
# - Channel where ticket threads are made. (only if ticket threads is enabled above.)
|
# - Channel where ticket threads are made. (only if ticket threads is enabled above.)
|
||||||
|
|
||||||
# For TicketType: channels
|
# For TicketType: channels
|
||||||
TicketChannelsCategory: "1111111111111111"
|
TicketChannelsCategory: "TICKET_CHANNELS_CATEGORY_ID"
|
||||||
TicketChannelsCategory2: "1111111111111111" # This will be used if the first category has reached the max channel limit.
|
TicketChannelsCategory2: "TICKET_CHANNELS_CATEGORY_ID_2" # This will be used if the first category has reached the max channel limit.
|
||||||
TicketArchiveCategory: "1111111111111111"
|
TicketArchiveCategory: "TICKET_ARCHIVE_CATEGORY_ID"
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
Channel: "ticket-" # The prefix for ticket channel names
|
Channel: "ticket-" # The prefix for ticket channel names
|
||||||
@@ -197,8 +197,8 @@ Ticket:
|
|||||||
StaffOnly: true
|
StaffOnly: true
|
||||||
|
|
||||||
ClaimTickets:
|
ClaimTickets:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
Channel: "1111111111111111"
|
Channel: "CLAIM_TICKETS_CHANNEL_ID"
|
||||||
# Channel where the ticket assignments are sent for staff to claim.
|
# Channel where the ticket assignments are sent for staff to claim.
|
||||||
|
|
||||||
ClaimAcceptTime: 120000
|
ClaimAcceptTime: 120000
|
||||||
@@ -220,8 +220,8 @@ Ticket:
|
|||||||
# 4 - Red
|
# 4 - Red
|
||||||
|
|
||||||
ReviewSystem:
|
ReviewSystem:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
Channel: "1111111111111111"
|
Channel: "REVIEW_CHANNEL_ID"
|
||||||
UseModal: true
|
UseModal: true
|
||||||
|
|
||||||
Questions:
|
Questions:
|
||||||
@@ -232,9 +232,9 @@ Ticket:
|
|||||||
- "Have you tried resolving the issue yourself?"
|
- "Have you tried resolving the issue yourself?"
|
||||||
|
|
||||||
Log:
|
Log:
|
||||||
TicketDataLog: "1111111111111111"
|
TicketDataLog: "TICKKET_DATA_LOG_CHANNEL_ID"
|
||||||
TickeDataTitle: "Ticket Data"
|
TickeDataTitle: "Ticket Data"
|
||||||
TicketBlacklistLog: "1111111111111111"
|
TicketBlacklistLog: "TICKET_BLACKLIST_LOG_CHANNEL_ID"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Buttons
|
# Buttons
|
||||||
@@ -258,7 +258,6 @@ Buttons:
|
|||||||
Unlock: "Unlock Ticket"
|
Unlock: "Unlock Ticket"
|
||||||
Unlock_Emoji: "🔓"
|
Unlock_Emoji: "🔓"
|
||||||
Unlock_Style: "2"
|
Unlock_Style: "2"
|
||||||
|
|
||||||
# Available Button Styles
|
# Available Button Styles
|
||||||
# 1 - Blurple
|
# 1 - Blurple
|
||||||
# 2 - Grey
|
# 2 - Grey
|
||||||
@@ -287,12 +286,12 @@ SelectMenus:
|
|||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
MessageDelete:
|
MessageDelete:
|
||||||
Channel: "1111111111111111"
|
Channel: "LOG_CHANNEL_ID"
|
||||||
Colour: "#d92525"
|
Colour: "#d92525"
|
||||||
|
|
||||||
MessageUpdate:
|
MessageUpdate:
|
||||||
Channel: "1111111111111111"
|
Channel: "LOG_CHANNEL_ID"
|
||||||
Colour: "#f2a024"
|
Colour: "#f2a024"
|
||||||
|
|
||||||
Translate:
|
Translate:
|
||||||
TranslateLog: "1111111111111111"
|
TranslateLog: "LOG_CHANNEL_ID"
|
||||||
@@ -1 +1 @@
|
|||||||
{}
|
|
||||||
@@ -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)
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2025 Emerald Services
|
Copyright (c) 2026 Emerald Services
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
| SupportBot | Node.JS | Discord.JS | Supported |
|
| SupportBot | Node.JS | Discord.JS | Supported |
|
||||||
|------------|---------|------------|------------|
|
|------------|---------|------------|------------|
|
||||||
| 8.x | 20.x | 14.x. | ✅ Yes
|
| 8.x | 22.x | 14.x. | ✅ Yes
|
||||||
| 7.7.3 | 16.x | 13.x. | ✅ Yes
|
| 7.7.3 | 16.x | 13.x. | ❌ No
|
||||||
| 7.x | 16.x | 13.x. | ❌ No
|
| 7.x | 16.x | 13.x. | ❌ No
|
||||||
| 6.x | 14.x | 13.x. | ❌ No
|
| 6.x | 14.x | 13.x. | ❌ No
|
||||||
| 5.x | 12.x | 13.x. | ❌ No
|
| 5.x | 12.x | 13.x. | ❌ No
|
||||||
@@ -74,7 +74,7 @@ Released under the [MIT](https://opensource.org/licenses/MIT) license.
|
|||||||
|
|
||||||
- [Official addons repository](https://github.com/Emerald-Services/Addons/)
|
- [Official addons repository](https://github.com/Emerald-Services/Addons/)
|
||||||
- [Syphers Addons](https://github.com/SypherRed/SB_Addons_Unofficial)
|
- [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)
|
- [Polymart](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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