Compare commits

..
21 Commits
Author SHA1 Message Date
ItzEmerald 44fbe9f2d6 FINAL 7.7 2022-06-28 03:15:52 +01:00
ItzEmerald 29db6c7d67 7.7 FINAL BETA 2022-06-28 03:14:54 +01:00
ItzEmerald 69f0b00ed3 7.7 2022-06-23 00:05:08 +01:00
ItzEmerald c1a1839457 7.7 BETA 3 2022-06-22 23:30:59 +01:00
Xiled Emerald dd4b53800e Merge pull request #124 from Emerald-Services/add-license-1
Create LICENSE.md
2022-06-22 23:05:38 +01:00
Xiled Emerald 1fc94528fc Merge pull request #123 from SypherRed/release
embed fix and updates
2022-06-22 23:05:25 +01:00
SypherRed bb1a817980 fix previous push of embed
fixed the if-statement of embed
2022-06-22 20:59:45 +02:00
SypherRed 53305acbc7 Fixed embed command
Added a check if the field options are used, if not leave it ignored and don't add some.

This was fixed due to ticket-0038.
2022-06-22 18:21:25 +02:00
Xiled Emerald d0f1bae0bd Create LICENSE.md 2022-06-22 02:24:19 +01:00
SypherRed c0cf3b1bb7 Update several files
* added to .gitignore ".DS_Store"

* changed commented head in "suggest.js" and "translate.js"

* Removed "AboutMe" due it to being unfunctional and can be set in the Developer Portal

* Removed the icon in "ticket-panel.yml"

* Updated dependencies and changed version to match current
2022-06-21 09:54:22 +02:00
Xiled Emerald ce67b668d5 Update Client.js 2022-06-21 01:42:59 +01:00
Xiled Emerald 3273cfd0e1 Update help.js 2022-06-21 01:41:53 +01:00
Xiled Emerald fd992a6514 Update supportbot.yml 2022-06-21 01:41:17 +01:00
Xiled Emerald 550d681fe1 Merge pull request #122 from RandomTomato/release
Added 3 new settings in supportbot.yml for more customization
2022-06-21 01:39:35 +01:00
ItzEmerald 7d29226953 BETA 2 - V7.7 2022-06-21 01:38:22 +01:00
BuildTools 38da72ca91 Added 3 new settings in supportbot.yml for more customization 2022-06-18 11:19:12 +09:30
Xiled Emerald eab11361cb Update ticket-panel-id.json 2022-06-16 22:30:13 +01:00
Xiled Emerald b281bba36f Merge pull request #120 from Emerald-Services/beta
7.6 Release
2022-06-16 22:26:50 +01:00
ItzEmerald 5e38573aed 7.6 2022-06-16 22:12:14 +01:00
ItzEmerald da7b6d487c 7.6-Pre1
Whats New?
  - Ability to add as many departments as you need (Don't go to crazy 😂 )
  - Merged Sypher's Translate & UserInfo Addon into Features

------------

  - Add a role automatically when a user joins the server
  - Announce a welcome message with full cusomtization
  - Announce a leave message with full cusomtization
  - Added "ephermal" to majority messages.

Install modules use - npm install
2022-06-16 02:31:58 +01:00
Xiled Emerald 6bf4e5f4bb Update README.md 2022-06-14 23:02:12 +01:00
29 changed files with 1392 additions and 403 deletions

No files matched your search

Vendored
BIN
View File
Binary file not shown.
-40
View File
@@ -1,40 +0,0 @@
---
name: "\U0001F41B Bug report"
about: Create a report to help us improve
title: "[BUG]"
labels: Bug
assignees: ""
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
@@ -1,19 +0,0 @@
---
name: "❓Suggest an Idea?"
about: Suggest an idea for SupportBot?
title: "[SUGGESTION]"
labels: Suggestion
assignees: ""
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
-28
View File
@@ -1,28 +0,0 @@
# This workflow will do a clean installation of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [dev, release]
pull_request:
branches: [dev, release]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 17.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
+2 -1
View File
@@ -1 +1,2 @@
node_modules/ node_modules/
.DS_Store
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -45,7 +45,7 @@ module.exports = new Command({
!interaction.member.roles.cache.has(SupportStaff.id) && !interaction.member.roles.cache.has(SupportStaff.id) &&
!interaction.member.roles.cache.has(Admin.id) !interaction.member.roles.cache.has(Admin.id)
) )
return interaction.reply({ embeds: [NoPerms] }); return interaction.reply({ ephemeral: true, embeds: [NoPerms] });
let TicketData = await JSON.parse( let TicketData = await JSON.parse(
fs.readFileSync("./Data/TicketData.json", "utf8") fs.readFileSync("./Data/TicketData.json", "utf8")
@@ -58,7 +58,7 @@ module.exports = new Command({
.setTitle("No Ticket Found!") .setTitle("No Ticket Found!")
.setDescription(supportbot.NoValidTicket) .setDescription(supportbot.NoValidTicket)
.setColor(supportbot.WarningColour); .setColor(supportbot.WarningColour);
return interaction.reply({ embeds: [Exists] }); return interaction.reply({ ephemeral: true, embeds: [Exists] });
} }
let uMember = interaction.options.getUser("user"); let uMember = interaction.options.getUser("user");
+5 -5
View File
@@ -154,11 +154,11 @@ module.exports = new Command({
html += `-----<br><br>`; html += `-----<br><br>`;
} }
}); });
if (!(supportbot.DisableTicketLogChannel)) {
await logChannel.send({ embeds: [logEmbed] }).catch((err) => { await logChannel.send({ embeds: [logEmbed] }).catch((err) => {
console.error(err); console.error(err);
}); });
}
let file = new Discord.MessageAttachment( let file = new Discord.MessageAttachment(
Buffer.from(html), Buffer.from(html),
`${interaction.channel.name}.html` `${interaction.channel.name}.html`
+2 -8
View File
@@ -22,42 +22,36 @@ module.exports = new Command({
type: "STRING", type: "STRING",
required: true, required: true,
}, },
{ {
name: "message", name: "message",
description: "Embed Message", description: "Embed Message",
type: "STRING", type: "STRING",
required: true, required: true,
}, },
{ {
name: "color", name: "color",
description: "Embed HEX Color", description: "Embed HEX Color",
type: "STRING", type: "STRING",
required: false, required: false,
}, },
{ {
name: "fieldtitle", name: "fieldtitle",
description: "Add an additional Embed Field", description: "Add an additional Embed Field",
type: "STRING", type: "STRING",
required: false, required: false,
}, },
{ {
name: "fieldcontent", name: "fieldcontent",
description: "Add an additional Embed Field", description: "Add an additional Embed Field",
type: "STRING", type: "STRING",
required: false, required: false,
}, },
{ {
name: "thumbnail", name: "thumbnail",
description: "Embed Thumbnail URL", description: "Embed Thumbnail URL",
type: "STRING", type: "STRING",
required: false, required: false,
}, },
{ {
name: "image", name: "image",
description: "Embed Image URL", description: "Embed Image URL",
@@ -98,10 +92,10 @@ module.exports = new Command({
const EmbedMsg = new Discord.MessageEmbed() const EmbedMsg = new Discord.MessageEmbed()
.setTitle(EmbedTitle) .setTitle(EmbedTitle)
.setDescription(EmbedSubject) .setDescription(EmbedSubject)
.addField(EmbedFieldTitle, EmbedFieldContent)
.setColor(EmbedColour) .setColor(EmbedColour)
.setThumbnail(EmbedThumbnail) .setThumbnail(EmbedThumbnail)
.setImage(EmbedImage); .setImage(EmbedImage)
if (EmbedFieldTitle && EmbedFieldContent) { EmbedMsg.addField(EmbedFieldTitle, EmbedFieldContent) };
interaction.reply({ interaction.reply({
embeds: [EmbedMsg], embeds: [EmbedMsg],
+8 -8
View File
@@ -31,6 +31,11 @@ module.exports = new Command({
botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`; botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`;
botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`; botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`;
botCommands += `**/${cmdconfig.PingCommand}** ${cmdconfig.PingCommandDesc}\n`; botCommands += `**/${cmdconfig.PingCommand}** ${cmdconfig.PingCommandDesc}\n`;
botCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
if (supportbot.DisableSuggestions === false) {
botCommands += `**/${cmdconfig.SuggestCommand}** ${cmdconfig.SuggestCommandDesc}\n`;
}
let ticketCommands = ""; let ticketCommands = "";
ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`; ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`;
@@ -39,6 +44,8 @@ module.exports = new Command({
let staffCommands = ""; let staffCommands = "";
staffCommands += `**/${cmdconfig.TicketAdd}** ${cmdconfig.TicketAddDesc}\n`; staffCommands += `**/${cmdconfig.TicketAdd}** ${cmdconfig.TicketAddDesc}\n`;
staffCommands += `**/${cmdconfig.TicketRemove}** ${cmdconfig.TicketRemoveDesc}\n`; staffCommands += `**/${cmdconfig.TicketRemove}** ${cmdconfig.TicketRemoveDesc}\n`;
staffCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
staffCommands += `**/${cmdconfig.TranslateCommand}** ${cmdconfig.TranslateCommandDesc}\n`;
const HelpEmbed1 = new Discord.MessageEmbed() const HelpEmbed1 = new Discord.MessageEmbed()
.setTitle(supportbot.Name + " Commands") .setTitle(supportbot.Name + " Commands")
@@ -74,16 +81,9 @@ module.exports = new Command({
}); });
} }
if (supportbot.SendHelpPage === "dm") {
interaction.user.send({
embeds: [HelpEmbed1],
});
}
if (supportbot.SendHelpPage === "channel") {
interaction.reply({ interaction.reply({
ephemeral: true,
embeds: [HelpEmbed1], embeds: [HelpEmbed1],
}); });
}
}, },
}); });
+2 -2
View File
@@ -57,7 +57,7 @@ module.exports = new Command({
.setTitle("No Ticket Found!") .setTitle("No Ticket Found!")
.setDescription(supportbot.NoValidTicket) .setDescription(supportbot.NoValidTicket)
.setColor(supportbot.WarningColour); .setColor(supportbot.WarningColour);
return interaction.reply({ embeds: [Exists] }); return interaction.reply({ ephemeral: true, embeds: [Exists] });
} }
let uMember = interaction.options.getUser("user"); let uMember = interaction.options.getUser("user");
@@ -68,7 +68,7 @@ module.exports = new Command({
) )
.setColor(supportbot.ErrorColour); .setColor(supportbot.ErrorColour);
if (!uMember) return interaction.reply({ embeds: [UserNotExist] }); if (!uMember) return interaction.reply({ ephemeral: true, embeds: [UserNotExist] });
await interaction.channel.permissionOverwrites.edit(uMember.id, { await interaction.channel.permissionOverwrites.edit(uMember.id, {
VIEW_CHANNEL: false, VIEW_CHANNEL: false,
+16 -2
View File
@@ -1,5 +1,5 @@
// SupportBot | Emerald Services // SupportBot | Emerald Services
// Ping Command // Suggest Command
const fs = require("fs"); const fs = require("fs");
@@ -55,6 +55,16 @@ module.exports = new Command({
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) { if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
await suggestionMsg.react(supportbot.SuggestionUpvote); await suggestionMsg.react(supportbot.SuggestionUpvote);
await suggestionMsg.react(supportbot.SuggestionDownvote); await suggestionMsg.react(supportbot.SuggestionDownvote);
if (supportbot.SuggestionThreads) {
await suggestionMsg.startThread({
name: `Suggestion-releated Thread`,
autoArchiveDuration: 60,
type: 'GUILD_PUBLIC_THREAD',
reason: 'Suggestion-releated thread',
})
}
} }
const Submitted = new Discord.MessageEmbed() const Submitted = new Discord.MessageEmbed()
@@ -65,6 +75,10 @@ module.exports = new Command({
.addField("Sent to:", `<#${suggestChannel.id}>`) .addField("Sent to:", `<#${suggestChannel.id}>`)
.setColor(supportbot.SuccessColour); .setColor(supportbot.SuccessColour);
return interaction.reply({ embeds: [Submitted] }); return interaction.reply({
ephemeral: true,
embeds: [Submitted]
})
}, },
}); });
+16 -15
View File
@@ -102,7 +102,7 @@ module.exports = new Command({
ephemeral: true, ephemeral: true,
}); });
let TicketCategory = await getCategory( let TicketCategory = await getCategory(
supportbot.Departments[department].category || supportbot.TicketCategory, supportbot.Departments[department].category,
interaction.guild interaction.guild
); );
const ticketChannel = await interaction.guild.channels.create( const ticketChannel = await interaction.guild.channels.create(
@@ -131,7 +131,7 @@ module.exports = new Command({
VIEW_CHANNEL: true, VIEW_CHANNEL: true,
}); });
} }
if (supportbot.TicketDepartments && !department) { if (!department) {
await ticketChannel.permissionOverwrites.edit(interaction.user.id, { await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
SEND_MESSAGES: false, SEND_MESSAGES: false,
}); });
@@ -196,7 +196,7 @@ module.exports = new Command({
} }
} }
if (supportbot.TicketDepartments && !department) { if (!department) {
TicketMessage.addFields({ TicketMessage.addFields({
name: "Departments", name: "Departments",
value: ` **${supportbot.Departments.map((X) => X.title).join("\n")}**`, value: ` **${supportbot.Departments.map((X) => X.title).join("\n")}**`,
@@ -215,7 +215,7 @@ module.exports = new Command({
.setEmoji(supportbot.TicketLockEmoji); .setEmoji(supportbot.TicketLockEmoji);
const row2 = new MessageActionRow().addComponents(CloseButton, LockButton); const row2 = new MessageActionRow().addComponents(CloseButton, LockButton);
if (supportbot.TicketDepartments && !department) { if (!department) {
try { try {
let buttons = await supportbot.Departments.map((x) => let buttons = await supportbot.Departments.map((x) =>
new MessageButton() new MessageButton()
@@ -306,22 +306,23 @@ module.exports = new Command({
VIEW_CHANNEL: true, VIEW_CHANNEL: true,
}); });
let TicketCat = await getCategory( let TicketCat = await getCategory(
supportbot.Departments[department].category || supportbot.Departments[department].category,
supportbot.TicketCategory,
interaction.guild interaction.guild
); );
await ticketChannel.setParent(TicketCat.id, { lockPermissions: false }); await ticketChannel.setParent(TicketCat.id, { lockPermissions: false });
await ticketChannel.send({ if (supportbot.AllowThanksForReachingOutMessage) {
embeds: [ await ticketChannel.send({
{ embeds: [
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`, {
color: supportbot.EmbedColour, description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
}, color: supportbot.EmbedColour,
], },
}); ],
});
}
} }
if (supportbot.AllowTicketMentions) { if (supportbot.AllowTicketMentions) {
await ticketChannel.send("@here"); await ticketChannel.send(supportbot.TicketRoleMention);
} }
} }
}, },
+108
View File
@@ -0,0 +1,108 @@
// SupportBot | Emerald Services
// Translate Command
const fs = require("fs");
const Discord = 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 Command = require("../Structures/Command.js");
const translate = require("@vitalets/google-translate-api");
module.exports = new Command({
name: cmdconfig.TranslateCommand, // Name of command
description: cmdconfig.TranslateCommandDesc, // Description of command
options: [
{
type: "STRING",
name: "language",
description: "A 2 letter language code",
required: true,
},
{
type: "STRING",
name: "text",
description: "The text to translate",
required: true,
}, // The input text for the translation
],
permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires
async run(interaction) {
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
if (!SupportStaff || !Admin)
return interaction.reply(
"Some roles seem to be missing!\nPlease check the error logs."
);
const NoPerms = new Discord.MessageEmbed()
.setTitle("Invalid Permissions!")
.setDescription(
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
)
.setColor(supportbot.WarningColour);
if (
!interaction.member.roles.cache.has(SupportStaff.id) &&
!interaction.member.roles.cache.has(Admin.id)
)
return interaction.reply({ embeds: [NoPerms] });
const { getChannel } = interaction.client;
let lang = interaction.options.getString("language"); // Grab choice of language code by user
let url = "https://www.science.co.il/language/Codes.php"; // URL to all available language codes
let text = await interaction.options.getString("text"); // Grab the text to translate by the user
let translatelog = await getChannel(
supportbot.TranslateLogChannel,
interaction.guild
); // Grab the set logging channel for translations
// Return message if user has provided an invalid language code
const result = await translate(text, { to: lang }).catch(async (err) => {
if (err && err.code == 400) {
await interaction.reply({
embeds: [
new Discord.MessageEmbed()
.setColor(supportbot.WarningColour)
.setTitle("Valid Language Codes")
.setURL(url)
.setDescription(
"Click the title to see which 2 letter language codes are valid."
),
],
ephemeral: true,
});
}
});
if (!result) return;
// Embed containing language code, original text and translated text
let transembed = new Discord.MessageEmbed()
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ dynamic: true }) })
.setColor(supportbot.SuccessColour)
.setDescription(`**Translation to ${lang}**`)
.addFields(
{ name: "Original text", value: text },
{ name: "Translated text", value: result.text },
)
.setFooter({ text: `Author: ${interaction.user.id}` })
.setTimestamp();
// Send embed [transembed] with translated message to channel
await interaction.reply({ embeds: [transembed] });
// Send embed [transembed] to logging channel
await translatelog.send({ embeds: [transembed] });
},
})
+127
View File
@@ -0,0 +1,127 @@
// SupportBot | Emerald Services
// User Info Command
const fs = require("fs");
const moment = require("moment");
const Discord = 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 Command = require("../Structures/Command.js");
module.exports = new Command({
name: cmdconfig.UserInfoCommand, // Name of command
description: cmdconfig.UserInfoCommandDesc, // Description of command
options: [
{
type: "USER",
name: "user",
description: "The user you want to get info about.",
required: true,
}, // The user input
],
permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires
async run(interaction) {
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
if (!SupportStaff || !Admin)
return interaction.reply(
"Some roles seem to be missing!\nPlease check the error logs."
);
const NoPerms = new Discord.MessageEmbed()
.setTitle("Invalid Permissions!")
.setDescription(
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
)
.setColor(supportbot.WarningColour);
if (
!interaction.member.roles.cache.has(SupportStaff.id) &&
!interaction.member.roles.cache.has(Admin.id)
)
return interaction.reply({ embeds: [NoPerms] });
let user = await interaction.options.getUser("user") || interaction.author; // Grab the mentioned user
let member = await interaction.guild.members.cache.get(user.id) // Check for user and his ID
const UserNotExist = new Discord.MessageEmbed()
.setTitle("User Not Found!")
.setDescription(
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.UserInfoCommand} <@!User_ID> or @User\``
)
.setColor(supportbot.ErrorColour);
if (!user) return interaction.reply({ embeds: [UserNotExist] });
// Flags a user/bot can have
const flags = {
DISCORD_EMPLOYEE: 'Discord Employee',
DISCORD_PARTNER: 'Discord Partner',
BUGHUNTER_LEVEL_1: 'Bug Hunter (Level 1)',
BUGHUNTER_LEVEL_2: 'Bug Hunter (Level 2)',
HYPESQUAD_EVENTS: 'HypeSquad Events',
HOUSE_BRAVERY: 'House of Bravery',
HOUSE_BRILLIANCE: 'House of Brilliance',
HOUSE_BALANCE: 'House of Balance',
EARLY_SUPPORTER: 'Early Supporter',
TEAM_USER: 'Team User',
SYSTEM: 'System',
VERIFIED_BOT: 'Verified Bot',
VERIFIED_DEVELOPER: 'Verified Bot Developer'
};
// Status message with icon
let status = {
online: "🟢Online",
idle: "🟡Idle",
dnd: "🔴Do Not Disturb",
offline: "⚫Offline"
};
const userFlags = user.flags.toArray();
// Embed containing the userinfo
let userembed = new Discord.MessageEmbed()
.setTitle(`User Info for User: ${user.tag}`)
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 512 }))
.setColor(member.roles.highest.hexColor)
.addFields(
{ name: "Name:", value: `${user.tag}\n<@${member.id}>`, inline: true },
{ name: "ID:", value: `${member.id}`, inline: true },
{ name: "Is Bot:", value: user.bot ? "Yes" : "No", inline: true },
{ name: "House/Badge:", value: `${userFlags.length ? userFlags.map(flag => flags[flag]).join("\n") : "None"}`, inline: true },
{ name: "Current Status:", value: `${status[member.presence ? member.presence.status : "offline"]}`, inline: true },
{ name: "Avatar URL:", value: `[Click Here](${member.displayAvatarURL()})`, inline: true },
{ name: "\u200b", value: "\u200b", inline: false}
)
.addFields(
{ name: "Creation Date:", value: `${moment(user.createdAt).format("MMMM Do YYYY, h:mm:ss a")}\n> ${moment(user.createdAt).startOf("day").fromNow()}`, inline: true },
{ name: "Joined Date:", value: `${moment(member.joinedAt).format("MMMM Do YYYY, h:mm:ss a")}\n> ${moment(member.joinedAt).startOf("day").fromNow()}`, inline: true },
{ name: "Roles Total:", value: `${member.roles.cache.size -1}`, inline: false },
{ name: "Highest Role:", value: `${member.roles.highest.id === interaction.guild.id ? "None" : member.roles.highest.toString()}`, inline: true },
{ name: "Roles:", value: `${member.roles.cache.map(r => r).join(" ").replace("@everyone", " ") || "None"}`, inline: false },
)
.setFooter({ text: supportbot.EmbedFooter })
.setTimestamp();
// Send embed [userembed]
await interaction.reply({ embeds: [userembed] }).catch((err) => console.error("An error has occured: ", err));
},
})
/**
* @INFO
* UserInfo command by Sypher#3415 | 321332200668790786
* @INFO
* Solely created for SupportBot | https://github.com/Emerald-Services/SupportBot/
**/
+6
View File
@@ -14,6 +14,7 @@
# Command Name Configuration # Command Name Configuration
# ------------------------------- # -------------------------------
Blacklist: "blacklist"
TicketAdd: "add" TicketAdd: "add"
TicketRemove: "remove" TicketRemove: "remove"
OpenTicket: "ticket" OpenTicket: "ticket"
@@ -23,13 +24,17 @@ PingCommand: "ping"
HelpCommand: "help" HelpCommand: "help"
EmbedCommand: "embed" EmbedCommand: "embed"
SuggestCommand: "suggest" SuggestCommand: "suggest"
TranslateCommand: "translate"
UserInfoCommand: "userinfo"
# --------------------------------------- # ---------------------------------------
# Command Description Configuration # Command Description Configuration
# --------------------------------------- # ---------------------------------------
BlacklistDesc: "Blacklist a user from creating Tickets."
TicketAddDesc: "Add a user to a support ticket." TicketAddDesc: "Add a user to a support ticket."
TicketRemoveDesc: "Remove a user from a support ticket." TicketRemoveDesc: "Remove a user from a support ticket."
TranslateCommandDesc: "Translates the language provided, along with the abbreviation (2 char) long language code"
OpenTicketDesc: "Open a new support ticket." OpenTicketDesc: "Open a new support ticket."
CloseTicketDesc: "Close your support ticket." CloseTicketDesc: "Close your support ticket."
InfoCommandDesc: "Get information about the brand." InfoCommandDesc: "Get information about the brand."
@@ -37,3 +42,4 @@ PingCommandDesc: "Pong!"
HelpCommandDesc: "Get a list of all the commands." HelpCommandDesc: "Get a list of all the commands."
EmbedCommandDesc: "Send a message as an embed." EmbedCommandDesc: "Send a message as an embed."
SuggestCommandDesc: "Suggest a feature for the server." SuggestCommandDesc: "Suggest a feature for the server."
UserInfoCommandDesc: "Get info about a user."
+123 -57
View File
@@ -10,20 +10,20 @@
# Discord Support: https://emeraldsrv.dev/discord # Discord Support: https://emeraldsrv.dev/discord
# Community Resources: https://emeraldsrv.dev/resources # Community Resources: https://emeraldsrv.dev/resources
SupportBot_Version: "7.5" SupportBot_Version: "v7.7"
# ------------------------- # -------------------------
# General Configuration # General Configuration
# ------------------------- # -------------------------
Name: "SupportBot" Name: "SupportBot"
Token: "BOT_TOKEN" Token: "BOT_TOKEN HTTPS://DISCORD.COM/DEVELOPERS"
# ------------------------- # -------------------------
# Activity Configuration # Activity Configuration
# ------------------------- # -------------------------
BotActivity: "Need Help? /ticket" BotActivity: "Here to help!"
StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME" StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME"
# Set The ActivityType to "STREAMING" for a streaming status! # Set The ActivityType to "STREAMING" for a streaming status!
@@ -36,40 +36,73 @@ ActivityType: "PLAYING"
# ------------------------- # -------------------------
EmbedColour: "#f74343" EmbedColour: "#f74343"
EmbedFooter: "SupportBot | An Advanced Ticket System" EmbedFooter: "SupportBot | Developed by Emerald Services"
ErrorColour: "#d12519" ErrorColour: "#d12519"
SuccessColour: "#04b545" SuccessColour: "#04b545"
WarningColour: "#fca117" WarningColour: "#fca117"
# -------------------------
# Information Configuration
# -------------------------
InfoTitle: "Information"
AboutMe: "Hi, I'm SupportBot an advanced discord ticket bot with 100% customization! [Download](https://emeraldsrv.dev/download)"
InfoButtonText: "Visit Site"
InfoURL: "https://emeraldsrv.dev"
InfoColour: "#f74343"
# -------------------------
# Help Configuration
# -------------------------
SendHelpPage: "channel" # Set to channel or dm
# ------------------------- # -------------------------
# Role Configuration # Role Configuration
# ------------------------- # -------------------------
AutoRole: true AutoRole: true
AutoRole_Role: "Member" JoinRole: "Member"
Staff: "Staff" Staff: "Staff"
Admin: "Admin" Admin: "Admin"
TicketBlackListRole: "Blacklisted" TicketBlackListRole: "Blacklisted"
# ----------------------------
# Join/Leave Configuration
# ----------------------------
Welcome: true
# set to false to disable joining logs
WelcomeChannel: "join-leave-logs"
WelcomeColour: "#f74343"
WelcomeTitle: "User Joined!"
WelcomeMessage: "%joined_user% has joined the server!"
# Available Placeholders:
# %joined_user% - Mentions the user who joined
EmbedWelcomeImage: true
EmbedWelcomeImageURL: "https://media.discordapp.net/attachments/958247876344025108/986777740738986094/unknown.png"
EmbedWelcomeThumbnail: "BOT"
# "USER" will display the user's profile picture.
# "BOT" will display the bot's profile picture.
# false to disable
Leave: true
# set to false to disable leaving logs
LeaveChannel: "join-leave-logs"
LeaveColour: "#f74343"
LeaveTitle: "User Left!"
LeaveMessage: "%joined_user% has left the server!"
# Available Placeholders:
# %joined_user% - Mentions the user who joined
EmbedLeaveImage: true
EmbedLeaveImageURL: "https://cdn.discordapp.com/attachments/958247876344025108/986778170223120384/unknown.png"
EmbedLeaveThumbnail: false
# "USER" will display the user's profile picture.
# "BOT" will display the bot's profile picture.
# false to disable
# -------------------------
# Information Configuration
# -------------------------
InfoTitle: "Information"
InfoButtonText: "Visit Site"
InfoURL: "https://emeraldsrv.dev"
InfoColour: "#f74343"
# ---------------------------- # ----------------------------
# Suggestions Configuration # Suggestions Configuration
# ---------------------------- # ----------------------------
@@ -78,20 +111,33 @@ SuggestionChannel: "suggestions"
SuggestionUpvote: "✅" SuggestionUpvote: "✅"
SuggestionDownvote: "❌" SuggestionDownvote: "❌"
SuggestionThreads: true
# set to false to disable threads being created from suggestions.
DisableSuggestions: false
# Set to true to disable the suggestions feature.
# -------------------------
# Translate Configuration
# -------------------------
TranslateLogChannel: "translations-log"
# ------------------------- # -------------------------
# Tickets Configuration # Tickets Configuration
# ------------------------- # -------------------------
TicketCategory: "Tickets" # Only for tickets without a category
TicketPrefix: "ticket-" # The prefix for ticket channel names TicketPrefix: "ticket-" # The prefix for ticket channel names
TicketLog: "ticket-logs" TicketLog: "ticket-data"
TranscriptLog: "transcripts" TranscriptLog: "ticket-data"
DMTranscripts: true DMTranscripts: true
TranscriptTitle: "Ticket Transcript" TranscriptTitle: "Ticket Transcript"
TicketLog_Title: "Ticket Closed" TicketLog_Title: "Ticket Closed"
TicketBlackListMessage: "You are not allowed to open a ticket" TicketBlackListMessage: "You are not allowed to open a ticket"
TicketRoleMention: "@here"
# To ping a role: <@ROLE_ID>
MaxAllowedTickets: 2 MaxAllowedTickets: 2
@@ -103,6 +149,12 @@ AllowTicketMentions: true
# Set to true to allow the ticket to mention the author and the support team. # Set to true to allow the ticket to mention the author and the support team.
# Set false to dis-allow mentions within tickets. # Set false to dis-allow mentions within tickets.
AllowThanksForReachingOutMessage: true
# Set to true to allow the "Thanks for reaching out Message" to be sent when the ticket is created
DisableTicketLogChannel: false
# Set to true to disable the requirement of the "TicketLog"
# Set to true to also disable the ticket logs to be sent in the "TicketLogs" channel
# --- Creation Config --- # --- Creation Config ---
# --- Start --- # --- Start ---
@@ -123,15 +175,51 @@ TicketCreatedAlert: ":ticket: Your support ticket has been created: <#%ticketid%
AddedUser: "👍 <@%user%> has been added to this ticket" AddedUser: "👍 <@%user%> has been added to this ticket"
RemovedUser: "👍 <@%user%> has been removed from this ticket" RemovedUser: "👍 <@%user%> has been removed from this ticket"
# --- Buttons Config --- # -------------------------
# --- Start --- # Tickets Categories
# -------------------------
Timeout: 5
# Set to true to allow all staff to access the ticket
AllowAllStaff: false
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been chosen.
Departments:
- title: "Support"
role: "Staff"
color: "SECONDARY"
emoji: "1️⃣"
category: "Tickets"
- title: "Billing Support"
role: "Staff"
color: "SECONDARY"
emoji: "2️⃣"
category: "Tickets"
- title: "Admin Team"
role: "Admin"
color: "SECONDARY"
emoji: "3️⃣"
category: "Tickets"
# - title: "Other"
# role: "Staff"
# color: "SECONDARY"
# emoji: "3️⃣"
# category: "Tickets"
# Discord Button Colour Selection # Discord Button Colour Selection
# PRIMARY - Blue # PRIMARY - Blurple
# SECONDARY - Grey # SECONDARY - Grey
# DANGER - Red # DANGER - Red
# SUCCESS - Green # SUCCESS - Green
# --- Buttons Config ---
# --- Start ---
LockTicketCategory: "Archive" LockTicketCategory: "Archive"
TicketCloseEmoji: "❌" TicketCloseEmoji: "❌"
@@ -142,45 +230,23 @@ TicketCloseColour: "DANGER"
TicketDeleteColour: "DANGER" TicketDeleteColour: "DANGER"
TicketLockColour: "PRIMARY" TicketLockColour: "PRIMARY"
# Discord Button Colour Selection
# PRIMARY - Blue
# SECONDARY - Grey
# DANGER - Red
# SUCCESS - Green
TranscriptSavedMessage: "📝 **Transcript Saved!**" TranscriptSavedMessage: "📝 **Transcript Saved!**"
TicketLockMessage: "❌ **Ticket Locked!**" TicketLockMessage: "❌ **Ticket Locked!**"
TicketDeleteMessage: "⚠ **Ticket Deleting!**" # Tickets deleting after 5 seconds by default. TicketDeleteMessage: "⚠ **Ticket Deleting!**" # Tickets deleting after 5 seconds by default.
# --- Departments Config ---
# --- Start ---
TicketDepartments: true
# Delete the ticket if no department selected. TIME IN MINUTES
Timeout: 5
# Set to true to allow all staff to access the ticket
AllowAllStaff: false
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been chosen.
Departments:
- title: "General Support"
role: "Support"
color: "PRIMARY"
emoji: "1️⃣"
category: "Tickets"
- title: "Billing Support"
role: "Support"
color: "PRIMARY"
emoji: "2️⃣"
category: "Billing"
- title: "Admin Team"
role: "Admin"
color: "PRIMARY"
emoji: "3️⃣"
category: "Tickets"
# --- Closing Config --- # --- Closing Config ---
# --- Start --- # --- Start ---
StaffOnly: true StaffOnly: true
ClosingTicket: ":warning: You have requested to close your support ticket." ClosingTicket: ":warning: You have requested to close your support ticket."
ClosingConfirmation_Word: "confirm" ClosingConfirmation_Word: "confirm"
CloseConfirmation: false CloseConfirmation: true
# --------------------------- # ---------------------------
# Error / Warning Messages # Error / Warning Messages
+5 -12
View File
@@ -20,22 +20,15 @@ TicketPanel: true
# Ticket Panel Message Configuration # Ticket Panel Message Configuration
# ---------------------------------------- # ----------------------------------------
Channel: "create-ticket" Channel: "ticket-creation"
ButtonEmoji: "📩"
ButtonLabel: "Open Ticket"
ButtonColour: "SUCCESS"
# Colour Options:
# -> PRIMARY - Purple
# -> SECONDARY - Grey
# -> SUCCESS - Green
# -> DANGER - Red
PanelTitle: "Need Help? Create a Support Ticket." PanelTitle: "Need Help? Create a Support Ticket."
PanelColour: "#f74343"
TicketPanel_Description: true TicketPanel_Description: true
TicketPanel_Thumbnail: false TicketPanel_Thumbnail: true
TicketPanel_Image: false TicketPanel_Image: true
PanelMessage: "Click the button to open a new support ticket." PanelMessage: "Click the button to open a new support ticket."
PanelThumbnail: "https://i.imgur.com/ieeZejl.png" PanelThumbnail: "https://i.imgur.com/ieeZejl.png"
PanelImage: "https://i.imgur.com/5NkcmDq.png" PanelImage: "https://i.imgur.com/5NkcmDq.png"
+1 -3
View File
@@ -1,3 +1 @@
{ {"tickets": [{}]}
"tickets": []
}
+4 -1
View File
@@ -1 +1,4 @@
{"id":0,"TicketPanelID":"947337678720999458"} {
"id": 0,
"TicketPanelID": ""
}
+32 -18
View File
@@ -8,25 +8,39 @@ const supportbot = yaml.load(
); );
module.exports = new Event("guildMemberAdd", async (client, member, interaction, guild) => { module.exports = new Event("guildMemberAdd", async (client, member, interaction, guild) => {
const WelcomeChannel = interaction.guild.channels.get(supportbot.WelcomeChannel)
const WelcomeEmbed = new Discord.MessageEmbed() if (supportbot.Welcome) {
.setColor(supportbot.WelcomeColour) const WelcomeChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.WelcomeChannel)
.setTitle(supportbot.WelcomeTitle)
.setDescription(supportbot.WelcomeMessage.replace(/%joined_user%/g, member.user))
.setThumbnail(member.user.displayAvatarURL())
.setTimestamp();
member.guild.channels.cache.get(
supportbot.WelcomeChannel).send({
embeds: [WelcomeEmbed]
const WelcomeEmbed = new Discord.MessageEmbed()
.setColor(supportbot.WelcomeColour)
.setTitle(supportbot.WelcomeTitle)
.setDescription(supportbot.WelcomeMessage.replace(/%joined_user%/g, member.user))
.setTimestamp();
if (supportbot.EmbedWelcomeThumbnail === "BOT") {
WelcomeEmbed.setThumbnail(client.user.displayAvatarURL())
}
if (supportbot.EmbedWelcomeThumbnail === "USER") {
WelcomeEmbed.setThumbnail(member.user.displayAvatarURL())
}
if (supportbot.EmbedWelcomeImage) {
WelcomeEmbed.setImage(supportbot.EmbedWelcomeImageURL)
}
WelcomeChannel.send({
embeds: [WelcomeEmbed]
}) })
if (supportbot.AutoRole) {
var role = member.guild.roles.cache.find(role => role.name === supportbot.JoinRole);
member.roles.add(role);
}
console.log(`\u001b[32m`, `[+]`, `\u001b[33m`, `${member.user.username} joined the server!`)
}
});
const WelcomeMsg = await WelcomeChannel.send({
embeds: [WelcomeEmbed]
});
});
+41
View File
@@ -0,0 +1,41 @@
const Discord = require('discord.js');
const fs = require("fs");
const Event = require("../Structures/Event.js");
const yaml = require("js-yaml");
const supportbot = yaml.load(
fs.readFileSync("./Configs/supportbot.yml", "utf8")
);
module.exports = new Event("guildMemberRemove", async (client, member, interaction, guild) => {
if (supportbot.Leave) {
const LeaveChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.LeaveChannel)
const LeaveEmbed = new Discord.MessageEmbed()
.setColor(supportbot.LeaveColour)
.setTitle(supportbot.LeaveTitle)
.setDescription(supportbot.LeaveMessage.replace(/%joined_user%/g, member.user))
.setTimestamp();
if (supportbot.EmbedLeaveThumbnail === "BOT") {
LeaveEmbed.setThumbnail(client.user.displayAvatarURL())
}
if (supportbot.EmbedLeaveThumbnail === "USER") {
LeaveEmbed.setThumbnail(member.user.displayAvatarURL())
}
if (supportbot.EmbedLeaveImage) {
LeaveEmbed.setImage(supportbot.EmbedLeaveImageURL)
}
LeaveChannel.send({
embeds: [LeaveEmbed]
})
console.log(`\u001b[31m`, `[-]`, `\u001b[33m`, `${member.user.username} joined the server!`)
}
});
+33 -36
View File
@@ -21,20 +21,21 @@ module.exports = new Event("ready", async (client, interaction) => {
url: supportbot.StreamingURL, url: supportbot.StreamingURL,
}); });
console.log(`\u001b[32m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`); console.log(`\u001b[107m`, `――――――――――――――――――――――――――――――――――――――――――――`);
console.log(`\u001b[32m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`); console.log(`\u001b[91m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`);
console.log(`\u001b[32m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`); console.log(`\u001b[91m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`);
console.log(`\u001b[32m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`); console.log(`\u001b[91m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`);
console.log(`\u001b[32m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`); console.log(`\u001b[91m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`);
console.log(`\u001b[32m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`); console.log(`\u001b[91m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`);
console.log(`\u001b[32m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`); console.log(`\u001b[91m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`);
console.log(`\u001b[32m`, `╋╋╋╋╋╋╋┗┛╋┗┛`); console.log(`\u001b[91m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`);
console.log(`\u001b[91m`, `╋╋╋╋╋╋╋┗┛╋┗┛`);
console.log(` `); console.log(` `);
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`); console.log(`\u001b[32m`, `――――――――――――――――――――――――――――――――――――――――――――`);
console.log(` `); console.log(` `);
console.log( console.log(
`\u001b[33m`, `\u001b[33m`,
`${supportbot.Name} v${supportbot.SupportBot_Version}`, `${supportbot.Name} | v${supportbot.SupportBot_Version}`,
`\u001b[36m`, `\u001b[36m`,
`Connected to Discord` `Connected to Discord`
); );
@@ -74,35 +75,37 @@ module.exports = new Event("ready", async (client, interaction) => {
console.log(`\u001b[37m`, `SupportBot proudly created by Emerald Services`); console.log(`\u001b[37m`, `SupportBot proudly created by Emerald Services`);
console.log(` `); console.log(` `);
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`); console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
if (client.guilds.cache.size !== 1) {
console.log(
`\u001b[31m`,
`${client.user.username} must be in only 1 server. Please join this server, leave any others, and restart the bot.`
);
console.log(`\u001b[31m`, `${client.user.username} will now exit.`);
return process.exit(1);
}
const roles = [ const roles = [
supportbot.Admin, supportbot.Admin,
supportbot.Staff, supportbot.Staff,
supportbot.TicketBlackListRole, supportbot.TicketBlackListRole,
]; ];
if (supportbot.TicketDepartments) {
supportbot.Departments.forEach((department) => roles.push(department.role)); supportbot.Departments.forEach((department) => roles.push(department.role));
}
if (supportbot.AutoRole) roles.push(supportbot.AutoRole_Role); if (supportbot.AutoRole) roles.push(supportbot.JoinRole);
const channels = [ const channels = [
supportbot.SuggestionChannel, supportbot.SuggestionChannel,
supportbot.TicketLog, supportbot.TicketLog,
supportbot.TranscriptLog, supportbot.TranscriptLog,
panelconfig.Channel, panelconfig.Channel,
supportbot.WelcomeChannel,
supportbot.LeaveChannel,
supportbot.TranslateLogChannel
]; ];
const categories = [supportbot.TicketCategory]; //const categories = [supportbot.TicketCategory];
const missingC = []; const missingC = [];
const missingR = []; const missingR = [];
const missingCat = []; const missingCat = [];
for (let c of channels) { for (let c of channels) {
if ((c === supportbot.SuggestionChannel && supportbot.DisableSuggestionsChannel) || c === supportbot.TicketLog && supportbot.DisableTicketLogChannel) {
continue;
}
const find = await getChannel(c, client.guilds.cache.first()); const find = await getChannel(c, client.guilds.cache.first());
if (!find) missingC.push(c); if (!find) missingC.push(c);
} }
@@ -110,10 +113,10 @@ module.exports = new Event("ready", async (client, interaction) => {
const find = await getRole(r, client.guilds.cache.first()); const find = await getRole(r, client.guilds.cache.first());
if (!find) missingR.push(r); if (!find) missingR.push(r);
} }
for (let cat of categories) { // for (let cat of categories) {
const find = await getCategory(cat, client.guilds.cache.first()); // const find = await getCategory(cat, client.guilds.cache.first());
if (!find) missingCat.push(cat); // if (!find) missingCat.push(cat);
} // }
if (missingR.length > 0) { if (missingR.length > 0) {
console.log( console.log(
@@ -161,7 +164,7 @@ module.exports = new Event("ready", async (client, interaction) => {
chan1.messages.fetch(panelid.TicketPanelID).catch(async () => { chan1.messages.fetch(panelid.TicketPanelID).catch(async () => {
let embed = new Discord.MessageEmbed() let embed = new Discord.MessageEmbed()
.setTitle(panelconfig.PanelTitle) .setTitle(panelconfig.PanelTitle)
.setColor(supportbot.SuccessColour) .setColor(panelconfig.PanelColour)
.setFooter({ .setFooter({
text: supportbot.EmbedFooter, text: supportbot.EmbedFooter,
iconURL: interaction.user.displayAvatarURL(), iconURL: interaction.user.displayAvatarURL(),
@@ -179,7 +182,7 @@ module.exports = new Event("ready", async (client, interaction) => {
embed.setImage(panelconfig.PanelImage); embed.setImage(panelconfig.PanelImage);
} }
let button; let button;
if (supportbot.TicketDepartments) {
button = supportbot.Departments.map((x) => button = supportbot.Departments.map((x) =>
new Discord.MessageButton() new Discord.MessageButton()
.setCustomId("department-" + supportbot.Departments.indexOf(x)) .setCustomId("department-" + supportbot.Departments.indexOf(x))
@@ -187,13 +190,7 @@ module.exports = new Event("ready", async (client, interaction) => {
.setStyle(x.color) .setStyle(x.color)
.setEmoji(x.emoji) .setEmoji(x.emoji)
); );
} else {
button = new Discord.MessageButton()
.setLabel(panelconfig.ButtonLabel)
.setCustomId("openticket")
.setStyle(panelconfig.ButtonColour)
.setEmoji(panelconfig.ButtonEmoji);
}
let row = new Discord.MessageActionRow().addComponents(button); let row = new Discord.MessageActionRow().addComponents(button);
await chan1 await chan1
@@ -217,4 +214,4 @@ module.exports = new Event("ready", async (client, interaction) => {
}); });
}); });
} }
}); });
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Emerald Services
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-1
View File
@@ -9,5 +9,4 @@ SupportBot is an open-sourced support system for discord. It's completely free t
**|** [Discord](https://emeraldsrv.dev/discord) **|** **|** [Discord](https://emeraldsrv.dev/discord) **|**
[Hosting](https://emeraldsrv.dev/hosting) **|** [Hosting](https://emeraldsrv.dev/hosting) **|**
[Documentation](https://emeraldsrv.dev/wiki/supportbot) **|** [Documentation](https://emeraldsrv.dev/wiki/supportbot) **|**
[Download via Polymart](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518) **|**
[Download via MC-Market](https://www.mc-market.org/resources/8940/) **|** [Download via MC-Market](https://www.mc-market.org/resources/8940/) **|**
+7 -3
View File
@@ -38,9 +38,13 @@ class Client extends Discord.Client {
} }
async start(token) { async start(token) {
const commandFiles = fs var tempCommandFiles = fs.readdirSync("./Commands").filter((file) => file.endsWith(".js"));
.readdirSync("./Commands")
.filter((file) => file.endsWith(".js")); if (supportbot.DisableSuggestions) {
tempCommandFiles = tempCommandFiles.filter(item => item !== "suggest.js");
}
const commandFiles = tempCommandFiles;
const addonFiles = fs const addonFiles = fs
.readdirSync("./Addons") .readdirSync("./Addons")
+827 -140
View File
File diff suppressed because it is too large. Load diff
+4 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "supportbot", "name": "supportbot",
"version": "7.4.2", "version": "7.7b",
"description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.", "description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@@ -18,7 +18,9 @@
}, },
"homepage": "https://github.com/Emerald-Services/SupportBot#readme", "homepage": "https://github.com/Emerald-Services/SupportBot#readme",
"dependencies": { "dependencies": {
"@vitalets/google-translate-api": "^8.0.0",
"discord.js": "^13.6.0", "discord.js": "^13.6.0",
"js-yaml": "^4.1.0" "js-yaml": "^4.1.0",
"moment": "^2.29.3"
} }
} }