Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee9742d92b | ||
|
|
ec955d8dc9 | ||
|
|
bbeea5db3e | ||
|
|
6e16cec661 | ||
|
|
9245157d71 | ||
|
|
787c9e62c5 | ||
|
|
628601518b | ||
|
|
87f974e00d | ||
|
|
20acafbc64 | ||
|
|
6a5406c4a8 | ||
|
|
949d113cff | ||
|
|
bd1e59ba54 | ||
|
|
364338a04e | ||
|
|
684dc827a3 | ||
|
|
fb97532bf5 | ||
|
|
a05812db10 | ||
|
|
96a50743ac | ||
|
|
5cd759eb86 | ||
|
|
fd263d1f8e | ||
|
|
df5c35642d | ||
|
|
c9d2e471b7 | ||
|
|
d1bd624723 | ||
|
|
1f2bd9c279 | ||
|
|
ab14b17cc9 | ||
|
|
e1244f779f | ||
|
|
d474f04122 | ||
|
|
24c4cb0dd1 | ||
|
|
d7d765d4b9 | ||
|
|
bc82bf6c55 | ||
|
|
213f84f509 | ||
|
|
25c6c95ec5 | ||
|
|
9118bff570 | ||
|
|
3f3670b4f3 | ||
|
|
d448662072 | ||
|
|
84fa2c3078 | ||
|
|
da88fe64ba | ||
|
|
d74cd36880 | ||
|
|
b8d1361796 | ||
|
|
b205132d1a | ||
|
|
77812967de | ||
|
|
6103fc9f04 | ||
|
|
44fbe9f2d6 | ||
|
|
29db6c7d67 | ||
|
|
69f0b00ed3 | ||
|
|
c1a1839457 | ||
|
|
dd4b53800e | ||
|
|
1fc94528fc | ||
|
|
bb1a817980 | ||
|
|
53305acbc7 | ||
|
|
d0f1bae0bd | ||
|
|
c0cf3b1bb7 | ||
|
|
ce67b668d5 | ||
|
|
3273cfd0e1 | ||
|
|
fd992a6514 | ||
|
|
550d681fe1 | ||
|
|
7d29226953 | ||
|
|
38da72ca91 | ||
|
|
eab11361cb | ||
|
|
b281bba36f | ||
|
|
5e38573aed | ||
|
|
da7b6d487c | ||
|
|
6bf4e5f4bb | ||
|
|
213f532a3c | ||
|
|
45bd88e4d2 | ||
|
|
4eb8658459 | ||
|
|
b37118fee2 | ||
|
|
026caba68a | ||
|
|
2003f8801a | ||
|
|
473bacf13a | ||
|
|
8b3f2bc61a | ||
|
|
3aa373c33c | ||
|
|
9b6263e583 | ||
|
|
3e066d08ce | ||
|
|
aa48e28162 | ||
|
|
dc660ed94a | ||
|
|
e02ecf9553 | ||
|
|
23acc0926f | ||
|
|
3fc1cd18d5 | ||
|
|
ebe29b403e | ||
|
|
dcba3312dd | ||
|
|
7fddeeec37 | ||
|
|
b5341b023f | ||
|
|
bbb7443ef2 | ||
|
|
22df347bb9 | ||
|
|
9aed6b8f35 | ||
|
|
9e7ec9f1bd | ||
|
|
373f43eac5 | ||
|
|
6c91b2791a | ||
|
|
bde62a431f | ||
|
|
615a074540 | ||
|
|
09b335ac46 | ||
|
|
2701880c77 | ||
|
|
24c8f2fb38 | ||
|
|
c3ec158ac3 | ||
|
|
b3690222d0 | ||
|
|
4d7583785b | ||
|
|
17ad1a15db | ||
|
|
4c89de9e76 | ||
|
|
5f25af41f9 | ||
|
|
3a3ee357fc | ||
|
|
08a6d27903 | ||
|
|
33f7675aac | ||
|
|
1178a0a611 | ||
|
|
96ded77bec | ||
|
|
e83ca8cb2b | ||
|
|
e507176d39 | ||
|
|
4e554b8bee | ||
|
|
bc649caa99 | ||
|
|
f7a4c7b616 | ||
|
|
2c7be5882c | ||
|
|
6107d268f7 | ||
|
|
7760699155 | ||
|
|
acf349c72e | ||
|
|
8096e5b882 | ||
|
|
873cfc7dc2 | ||
|
|
038174bc7e | ||
|
|
14881096bb | ||
|
|
ed1905d8f4 | ||
|
|
72c0a2efa3 | ||
|
|
e599d48713 | ||
|
|
7f44634d4f | ||
|
|
44170caac6 | ||
|
|
adedfadd92 | ||
|
|
6b01d0c8fe | ||
|
|
d4d96f59ab | ||
|
|
a1bf7ed6bd | ||
|
|
306e20efc9 | ||
|
|
f593f6e0a8 | ||
|
|
74646a4318 | ||
|
|
8bfcba8832 | ||
|
|
4ba5621a4d | ||
|
|
1f928324c2 | ||
|
|
3771872cd2 | ||
|
|
f359a60343 | ||
|
|
f53afd7bc9 | ||
|
|
e7dcc2ab29 | ||
|
|
0118b9e591 | ||
|
|
ffe42f9777 | ||
|
|
5a467599e9 | ||
|
|
c56e78484a | ||
|
|
1ee0d4a09e | ||
|
|
ffdce5820b | ||
|
|
9fed504f37 | ||
|
|
6c5799be0d | ||
|
|
b6747a0340 | ||
|
|
cd6df02e30 | ||
|
|
edbef6a36f | ||
|
|
b6a0016f5f | ||
|
|
e740c17837 | ||
|
|
7eb949f109 | ||
|
|
02394e310d | ||
|
|
ef83832819 | ||
|
|
a82101ab30 | ||
|
|
007c78930e | ||
|
|
300c83512c | ||
|
|
b674872c56 | ||
|
|
12a7680275 | ||
|
|
c9cf7c942b | ||
|
|
8e0326c8f8 | ||
|
|
13972119a8 | ||
|
|
acf165a119 |
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [Emerald-Services]
|
||||||
@@ -1,20 +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.
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
name: "\U0001F41B Bug report"
|
name: Bug report
|
||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
title: "[BUG]"
|
title: ''
|
||||||
labels: Bug
|
labels: ''
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
# This workflow will do a clean install 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: [master]
|
|
||||||
pull_request:
|
|
||||||
branches: [master]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [10.x, 12.x, 14.x, 15.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 install discord.js --save
|
|
||||||
- run: npm install js-yaml
|
|
||||||
- run: npm run build --if-present
|
|
||||||
- run: node index.js
|
|
||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
.DS_Store
|
||||||
+30
-18
@@ -10,24 +10,36 @@ const supportbot = yaml.load(
|
|||||||
);
|
);
|
||||||
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
// Your Addon Config file! Saved in /Addons/Settings/YourAddonConfig.yml
|
// Your Addon Config file! Saved in /Addons/Configs/YourAddonConfig.yml
|
||||||
// const exampleaddon = yaml.load(fs.readFileSync('./Addons/Settings/YourAddonConfig.yml', 'utf8'));
|
// const config = yaml.load(fs.readFileSync('./Addons/Configs/YourAddonConfig.yml', 'utf8'));
|
||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const { Command, Event } = require("../Structures/Addon");
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports.commands = [
|
||||||
name: "hello",
|
/*
|
||||||
description: "hello",
|
// EXAMPLE COMMAND
|
||||||
slashCommandOptions: [],
|
new Command({
|
||||||
permission: "SEND_MESSAGES",
|
name: "hello",
|
||||||
|
description: "hello",
|
||||||
|
options: [],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
async run(interaction) {
|
||||||
|
const Embed = new Discord.MessageEmbed()
|
||||||
|
.setDescription("Hello World!")
|
||||||
|
.setColor(supportbot.InfoColour);
|
||||||
|
|
||||||
async run(interaction) {
|
interaction.reply({
|
||||||
const Embed = new Discord.MessageEmbed()
|
embeds: [Embed],
|
||||||
.setDescription("Hello World!")
|
});
|
||||||
.setColor(supportbot.InfoColour);
|
},
|
||||||
|
}),
|
||||||
interaction.reply({
|
*/
|
||||||
embeds: [Embed],
|
];
|
||||||
});
|
module.exports.events = [
|
||||||
},
|
/*
|
||||||
});
|
// EXAMPLE EVENT
|
||||||
|
new Event("ready", async (client) => {
|
||||||
|
console.log("Bot started!");
|
||||||
|
}),
|
||||||
|
*/
|
||||||
|
];
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity
|
||||||
|
and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
* Demonstrating empathy and kindness toward other people
|
||||||
|
* Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
* Giving and gracefully accepting constructive feedback
|
||||||
|
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
* Focusing on what is best not just for us as individuals, but for the
|
||||||
|
overall community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery, and sexual attention or
|
||||||
|
advances of any kind
|
||||||
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or email
|
||||||
|
address, without their explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official e-mail address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at
|
||||||
|
our discord.
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series
|
||||||
|
of actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or
|
||||||
|
permanent ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within
|
||||||
|
the community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.0, available at
|
||||||
|
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||||
|
enforcement ladder](https://github.com/mozilla/diversity).
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
https://www.contributor-covenant.org/faq. Translations are available at
|
||||||
|
https://www.contributor-covenant.org/translations.
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
When contributing to this repository, please first discuss the change you wish to make via issue,
|
||||||
|
email, or any other method with the owners of this repository before making a change.
|
||||||
|
|
||||||
|
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
||||||
|
|
||||||
|
## Pull Request Process
|
||||||
|
|
||||||
|
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
|
||||||
|
build.
|
||||||
|
2. Update the README.md with details of changes to the interface, this includes new environment
|
||||||
|
variables, exposed ports, useful file locations and container parameters.
|
||||||
|
3. Increase the version numbers in any examples files and the README.md to the new version that this
|
||||||
|
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
|
||||||
|
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
|
||||||
|
do not have permission to do that, you may request the second reviewer to merge it for you.
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
### Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
|
contributors and maintainers pledge to making participation in our project and
|
||||||
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity and
|
||||||
|
orientation.
|
||||||
|
|
||||||
|
### Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
|
advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic
|
||||||
|
address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
### Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
### Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies both within project spaces and in public spaces
|
||||||
|
when an individual is representing the project or its community. Examples of
|
||||||
|
representing a project or community include using an official project e-mail
|
||||||
|
address, posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event. Representation of a project may be
|
||||||
|
further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
### Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
||||||
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||||
|
faith may face temporary or permanent repercussions as determined by other
|
||||||
|
members of the project's leadership.
|
||||||
|
|
||||||
|
### Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at [http://contributor-covenant.org/version/1/4][version]
|
||||||
|
|
||||||
|
[homepage]: http://contributor-covenant.org
|
||||||
|
[version]: http://contributor-covenant.org/version/1/4/
|
||||||
+52
-55
@@ -12,16 +12,10 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
|||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.TicketAdd,
|
name: cmdconfig.TicketAdd,
|
||||||
description: cmdconfig.TicketAddDesc,
|
description: cmdconfig.TicketAddDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "user",
|
name: "user",
|
||||||
description: "User to add",
|
description: "User to add",
|
||||||
@@ -29,22 +23,15 @@ module.exports = new Command({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let SupportStaff =
|
const { getRole } = interaction.client;
|
||||||
interaction.guild.roles.cache.find(
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
) ||
|
if (!SupportStaff || !Admin)
|
||||||
interaction.guild.roles.cache.find(
|
return interaction.reply(
|
||||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
);
|
|
||||||
let Admins =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
@@ -55,41 +42,51 @@ module.exports = new Command({
|
|||||||
.setColor(supportbot.WarningColour);
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
interaction.member.roles.cache.has(SupportStaff.id) ||
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
interaction.member.roles.cache.has(Admins.id)
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
) {
|
)
|
||||||
if (!interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
return interaction.reply({ ephemeral: true, embeds: [NoPerms] });
|
||||||
const Exists = new Discord.MessageEmbed()
|
|
||||||
.setTitle("No Ticket Found!")
|
|
||||||
.setDescription(`${supportbot.NoValidTicket}`)
|
|
||||||
.setColor(supportbot.WarningColour);
|
|
||||||
return interaction.reply({ embeds: [Exists] });
|
|
||||||
}
|
|
||||||
|
|
||||||
let uMember = interaction.options.getUser("user");
|
let TicketData = await JSON.parse(
|
||||||
const UserNotExist = new Discord.MessageEmbed()
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
.setTitle("User Not Found!")
|
);
|
||||||
.setDescription(
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketAdd} <user#0000>\``
|
(t) => t.id === interaction.channel.id
|
||||||
)
|
);
|
||||||
.setColor(supportbot.ErrorColour);
|
if (ticket === -1) {
|
||||||
|
const Exists = new Discord.MessageEmbed()
|
||||||
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
.setTitle("No Ticket Found!")
|
||||||
|
.setDescription(supportbot.NoValidTicket)
|
||||||
interaction.channel.permissionOverwrites.edit(uMember, {
|
.setColor(supportbot.WarningColour);
|
||||||
VIEW_CHANNEL: true,
|
return interaction.reply({ ephemeral: true, embeds: [Exists] });
|
||||||
READ_MESSAGE_HISTORY: true,
|
|
||||||
SEND_MESSAGES: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const Complete = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Added!")
|
|
||||||
.setDescription(supportbot.AddedUser.replace(/%user%/g, uMember.id))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
interaction.reply({ embeds: [Complete] });
|
|
||||||
} else {
|
|
||||||
return interaction.reply({ embeds: [NoPerms] });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let uMember = interaction.options.getUser("user");
|
||||||
|
const UserNotExist = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Not Found!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketAdd} <user#0000>\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
||||||
|
|
||||||
|
await interaction.channel.permissionOverwrites.edit(uMember.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
const Complete = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Added!")
|
||||||
|
.setDescription(supportbot.AddedUser.replace(/%user%/g, uMember.id))
|
||||||
|
.setTimestamp()
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
interaction.reply({ embeds: [Complete] });
|
||||||
|
TicketData.tickets[ticket].subUsers.push(uMember.id);
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+156
-188
@@ -11,35 +11,67 @@ const supportbot = yaml.load(
|
|||||||
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
const TicketNumberID = require("../Structures/TicketID.js");
|
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.CloseTicket,
|
name: cmdconfig.CloseTicket,
|
||||||
description: cmdconfig.CloseTicketDesc,
|
description: cmdconfig.CloseTicketDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "reason",
|
name: "reason",
|
||||||
description: "Ticket Close Reason",
|
description: "Ticket Close Reason",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
if (!interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
const { getRole, getChannel } = interaction.client;
|
||||||
|
if (supportbot.StaffOnly) {
|
||||||
|
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 for errors when starting the bot."
|
||||||
|
);
|
||||||
|
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] });
|
||||||
|
}
|
||||||
|
await interaction.deferReply();
|
||||||
|
let tickets = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
|
);
|
||||||
|
let TicketData = await tickets.tickets.findIndex(
|
||||||
|
(t) => t.id === interaction.channel.id
|
||||||
|
);
|
||||||
|
let ticket = tickets.tickets[TicketData];
|
||||||
|
if (TicketData === -1) {
|
||||||
const Exists = new Discord.MessageEmbed()
|
const Exists = new Discord.MessageEmbed()
|
||||||
.setTitle("No Ticket Found!")
|
.setTitle("No Ticket Found!")
|
||||||
.setDescription(`${supportbot.NoValidTicket}`)
|
.setDescription(supportbot.NoValidTicket)
|
||||||
.setColor(supportbot.WarningColour);
|
.setColor(supportbot.WarningColour);
|
||||||
return interaction.reply({ embed: Exists });
|
return interaction.followUp({ embeds: [Exists] });
|
||||||
}
|
}
|
||||||
|
let tUser = interaction.client.users.cache.get(ticket.user);
|
||||||
|
let transcriptChannel = await getChannel(
|
||||||
|
supportbot.TranscriptLog,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
let logChannel = await getChannel(supportbot.TicketLog, interaction.guild);
|
||||||
|
let reason =
|
||||||
|
(await interaction.options?.getString("reason")) || "No Reason Provided.";
|
||||||
|
|
||||||
|
if (!transcriptChannel || !logChannel)
|
||||||
|
return interaction.followUp("Some Channels seem to be missing!");
|
||||||
if (supportbot.CloseConfirmation) {
|
if (supportbot.CloseConfirmation) {
|
||||||
const CloseTicketRequest = new Discord.MessageEmbed()
|
const CloseTicketRequest = new Discord.MessageEmbed()
|
||||||
.setTitle(`**${supportbot.ClosingTicket}**`)
|
.setTitle(`**${supportbot.ClosingTicket}**`)
|
||||||
@@ -47,185 +79,121 @@ module.exports = new Command({
|
|||||||
`Please confirm by repeating the following word.. \`${supportbot.ClosingConfirmation_Word}\` `
|
`Please confirm by repeating the following word.. \`${supportbot.ClosingConfirmation_Word}\` `
|
||||||
)
|
)
|
||||||
.setColor(supportbot.EmbedColour);
|
.setColor(supportbot.EmbedColour);
|
||||||
|
await interaction.followUp({ embeds: [CloseTicketRequest] });
|
||||||
interaction
|
let filter = (m) =>
|
||||||
.reply(CloseTicketRequest)
|
m.content.toLowerCase() === supportbot.ClosingConfirmation_Word &&
|
||||||
.then((m) => {
|
m.author.id === interaction.user.id;
|
||||||
interaction.channel
|
await interaction.channel.awaitMessages({
|
||||||
.awaitMessages(
|
filter,
|
||||||
(response) =>
|
max: 1,
|
||||||
response.content.toLowerCase() ===
|
time: 20000,
|
||||||
supportbot.ClosingConfirmation_Word,
|
errors: ["time"],
|
||||||
{
|
});
|
||||||
max: 1,
|
|
||||||
time: 20000,
|
|
||||||
errors: ["time"],
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.then((collected) => {
|
|
||||||
let logChannel =
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(channel) => channel.name === supportbot.TranscriptLog
|
|
||||||
) ||
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(channel) => channel.id === supportbot.TranscriptLog
|
|
||||||
);
|
|
||||||
let user = interaction.user;
|
|
||||||
let reason =
|
|
||||||
interaction.options.getString("reason") ||
|
|
||||||
"No Reason Provided.";
|
|
||||||
|
|
||||||
let name = interaction.channel.name;
|
|
||||||
let ticketChannel = interaction.channel;
|
|
||||||
|
|
||||||
interaction
|
|
||||||
.reply(`**${supportbot.ClosingTicket}**`)
|
|
||||||
|
|
||||||
.then(() => {
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Closed By", interaction.user.tag)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
interaction.channel.interactions
|
|
||||||
.fetch({ limit: 100 })
|
|
||||||
.then((msgs) => {
|
|
||||||
let html = "";
|
|
||||||
|
|
||||||
msgs = msgs.sort(
|
|
||||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
|
||||||
);
|
|
||||||
html += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
|
||||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
|
||||||
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
|
||||||
|
|
||||||
msgs.forEach((msg) => {
|
|
||||||
if (msg.content) {
|
|
||||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
|
||||||
html += `-----<br><br>`;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
|
||||||
interaction.reply(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
let file = new Discord.MessageAttachment(
|
|
||||||
Buffer.from(html),
|
|
||||||
`${name}.html`
|
|
||||||
);
|
|
||||||
logChannel
|
|
||||||
.send({ embeds: [logEmbed], files: [file] })
|
|
||||||
.catch((err) => {
|
|
||||||
interaction.reply(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
interaction.channel.delete().catch((error) => {
|
|
||||||
if (
|
|
||||||
error.code !==
|
|
||||||
Discord.Constants.APIErrors.UNKNOWN_CHANNEL
|
|
||||||
) {
|
|
||||||
console.error(
|
|
||||||
"Failed to delete the interaction:",
|
|
||||||
error
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
interaction
|
|
||||||
.followUp({
|
|
||||||
content: "The request to close the ticket has timed out.",
|
|
||||||
})
|
|
||||||
.then((m2) => setTimeout(() => interaction.channel.delete(3000)));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
if (!supportbot.CloseConfirmation) {
|
tickets.tickets[TicketData].open = false;
|
||||||
let logChannel =
|
fs.writeFileSync(
|
||||||
interaction.guild.channels.cache.find(
|
"./Data/TicketData.json",
|
||||||
(channel) => channel.name === supportbot.TranscriptLog
|
JSON.stringify(tickets, null, 4),
|
||||||
) ||
|
(err) => {
|
||||||
interaction.guild.channels.cache.find(
|
if (err) console.error(err);
|
||||||
(channel) => channel.id === supportbot.TranscriptLog
|
}
|
||||||
);
|
);
|
||||||
let user = interaction.user;
|
await interaction.followUp(`**${supportbot.ClosingTicket}**`);
|
||||||
let reason =
|
const transcriptEmbed = new Discord.MessageEmbed()
|
||||||
(await interaction.options.getString("reason")) ||
|
.setTitle(supportbot.TranscriptTitle)
|
||||||
"No Reason Provided.";
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter({
|
||||||
let name = interaction.channel.name;
|
text: supportbot.EmbedFooter,
|
||||||
let ticketChannel = interaction.channel;
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
|
||||||
interaction
|
|
||||||
.reply(`**${supportbot.ClosingTicket}**`)
|
|
||||||
|
|
||||||
.then(() => {
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Closed By", interaction.user.tag)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
interaction.channel.interactions
|
|
||||||
.fetch({ limit: 100 })
|
|
||||||
.then((msgs) => {
|
|
||||||
let html = "";
|
|
||||||
|
|
||||||
msgs = msgs.sort(
|
|
||||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
|
||||||
);
|
|
||||||
html += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
|
||||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
|
||||||
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
|
||||||
|
|
||||||
msgs.forEach((msg) => {
|
|
||||||
if (msg.content) {
|
|
||||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
|
||||||
html += `-----<br><br>`;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
|
||||||
interaction.reply(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
let file = new Discord.MessageAttachment(
|
|
||||||
Buffer.from(html),
|
|
||||||
`${name}.html`
|
|
||||||
);
|
|
||||||
logChannel
|
|
||||||
.send({ embeds: [logEmbed], files: [file] })
|
|
||||||
.catch((err) => {
|
|
||||||
interaction.reply(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
interaction.channel.delete().catch((error) => {
|
|
||||||
if (
|
|
||||||
error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL
|
|
||||||
) {
|
|
||||||
console.error("Failed to delete the interaction:", error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.addField(
|
||||||
interaction
|
"Ticket",
|
||||||
.followUp({
|
`${interaction.channel.name} (${interaction.channel.id})`
|
||||||
content: "The request to close the ticket has timed out.",
|
)
|
||||||
})
|
.addField(
|
||||||
.then((m2) => setTimeout(() => interaction.channel.delete(3000)));
|
"User",
|
||||||
|
`${tUser?.username || "N/A"}#${tUser?.discriminator || "N/A"} (${
|
||||||
|
tUser?.id || ticket.user
|
||||||
|
})`
|
||||||
|
)
|
||||||
|
.addField("Closed By", interaction.user.tag)
|
||||||
|
.addField("Reason", reason);
|
||||||
|
const logEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.TicketLog_Title)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter({
|
||||||
|
text: supportbot.EmbedFooter,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
})
|
||||||
|
.addField(
|
||||||
|
"Ticket",
|
||||||
|
`${interaction.channel.name} (${interaction.channel.id})`
|
||||||
|
)
|
||||||
|
.addField(
|
||||||
|
"User",
|
||||||
|
`${tUser?.username || "N/A"}#${tUser?.discriminator || "N/A"} (${
|
||||||
|
tUser?.id || ticket.user
|
||||||
|
})`
|
||||||
|
)
|
||||||
|
.addField("Closed By", interaction.user.tag)
|
||||||
|
.addField("Reason", reason);
|
||||||
|
let msgs = await interaction.channel.messages.fetch({ limit: 100 });
|
||||||
|
let html = "";
|
||||||
|
|
||||||
|
msgs = msgs.sort((a, b) => a.createdTimestamp - b.createdTimestamp);
|
||||||
|
html += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
||||||
|
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||||
|
html += `<strong>Ticket:</strong> ${interaction.channel.name}<br>`;
|
||||||
|
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||||
|
|
||||||
|
await msgs.forEach((msg) => {
|
||||||
|
if (msg.content) {
|
||||||
|
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
||||||
|
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
||||||
|
html += `-----<br><br>`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!(supportbot.DisableTicketLogChannel)) {
|
||||||
|
await logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
||||||
|
console.error(err);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
let file = new Discord.MessageAttachment(
|
||||||
|
Buffer.from(html),
|
||||||
|
`${interaction.channel.name}.html`
|
||||||
|
);
|
||||||
|
await transcriptChannel
|
||||||
|
.send({ embeds: [transcriptEmbed], files: [file] })
|
||||||
|
.catch(async (err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (supportbot.DMTranscripts) {
|
||||||
|
|
||||||
|
await tUser
|
||||||
|
?.send({ embeds: [transcriptEmbed], files: [file] })
|
||||||
|
.catch(async (err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
if (ticket.subUsers) {
|
||||||
|
ticket.subUsers.forEach(async (subUser) => {
|
||||||
|
await interaction.client.users.cache
|
||||||
|
.get(subUser)
|
||||||
|
?.send({ embeds: [transcriptEmbed], files: [file] });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
await interaction.channel.delete().catch(async (error) => {
|
||||||
|
console.error(error);
|
||||||
|
if (error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL) {
|
||||||
|
console.error("Failed to delete the interaction:", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+52
-19
@@ -15,37 +15,61 @@ const Command = require("../Structures/Command.js");
|
|||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.EmbedCommand,
|
name: cmdconfig.EmbedCommand,
|
||||||
description: cmdconfig.EmbedCommandDesc,
|
description: cmdconfig.EmbedCommandDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "title",
|
name: "title",
|
||||||
description: "Embed Title",
|
description: "Embed Title",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "message",
|
name: "message",
|
||||||
description: "Embed Message",
|
description: "Embed Message",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "color",
|
||||||
|
description: "Embed HEX Color",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "fieldtitle",
|
||||||
|
description: "Add an additional Embed Field",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "fieldcontent",
|
||||||
|
description: "Add an additional Embed Field",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "thumbnail",
|
||||||
|
description: "Embed Thumbnail URL",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "image",
|
||||||
|
description: "Embed Image URL",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let SupportStaff =
|
const { getRole } = interaction.client;
|
||||||
interaction.guild.roles.cache.find(
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
|
||||||
);
|
|
||||||
let Admins =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
|
||||||
);
|
|
||||||
|
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
.setTitle("Invalid Permissions!")
|
.setTitle("Invalid Permissions!")
|
||||||
.setDescription(
|
.setDescription(
|
||||||
@@ -55,14 +79,23 @@ module.exports = new Command({
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
interaction.member.roles.cache.has(SupportStaff.id) ||
|
interaction.member.roles.cache.has(SupportStaff.id) ||
|
||||||
interaction.member.roles.cache.has(Admins.id)
|
interaction.member.roles.cache.has(Admin.id)
|
||||||
) {
|
) {
|
||||||
const EmbedTitle = interaction.options.getString("title");
|
const EmbedTitle = interaction.options.getString("title");
|
||||||
const EmbedSubject = interaction.options.getString("message");
|
const EmbedSubject = interaction.options.getString("message");
|
||||||
|
const EmbedColour = interaction.options.getString("color");
|
||||||
|
const EmbedThumbnail = interaction.options.getString("thumbnail");
|
||||||
|
const EmbedImage = interaction.options.getString("image");
|
||||||
|
const EmbedFieldContent = interaction.options.getString("fieldcontent");
|
||||||
|
const EmbedFieldTitle = interaction.options.getString("fieldtitle");
|
||||||
|
|
||||||
const EmbedMsg = new Discord.MessageEmbed()
|
const EmbedMsg = new Discord.MessageEmbed()
|
||||||
.setTitle(EmbedTitle)
|
.setTitle(EmbedTitle)
|
||||||
.setDescription(EmbedSubject);
|
.setDescription(EmbedSubject)
|
||||||
|
.setColor(EmbedColour)
|
||||||
|
.setThumbnail(EmbedThumbnail)
|
||||||
|
.setImage(EmbedImage)
|
||||||
|
if (EmbedFieldTitle && EmbedFieldContent) { EmbedMsg.addField(EmbedFieldTitle, EmbedFieldContent) };
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
embeds: [EmbedMsg],
|
embeds: [EmbedMsg],
|
||||||
|
|||||||
+64
-81
@@ -12,95 +12,78 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
|||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.HelpCommand,
|
name: cmdconfig.HelpCommand,
|
||||||
description: cmdconfig.HelpCommandDesc,
|
description: cmdconfig.HelpCommandDesc,
|
||||||
slashCommandOptions: [],
|
options: [],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let SupportStaff =
|
const { getRole } = interaction.client;
|
||||||
interaction.guild.roles.cache.find(
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
(adminRole) => adminRole.name === supportbot.Staff
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
) ||
|
if (!SupportStaff || !Admin)
|
||||||
interaction.guild.roles.cache.find(
|
return interaction.reply(
|
||||||
(staffRole) => staffRole.id === supportbot.Staff
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
);
|
|
||||||
let AdminStaff =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(adminRole) => adminRole.name === supportbot.Admin
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(adminRole) => adminRole.id === supportbot.Admin
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (supportbot.HelpMenu) {
|
let botCommands = "";
|
||||||
let botCommands = "";
|
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`;
|
||||||
|
|
||||||
let ticketCommands = "";
|
if (supportbot.DisableSuggestions === false) {
|
||||||
ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`;
|
botCommands += `**/${cmdconfig.SuggestCommand}** ${cmdconfig.SuggestCommandDesc}\n`;
|
||||||
ticketCommands += `**/${cmdconfig.CloseTicket}** ${cmdconfig.CloseTicketDesc}\n`;
|
|
||||||
|
|
||||||
let staffCommands = "";
|
|
||||||
staffCommands += `**/${cmdconfig.TicketAdd}** ${cmdconfig.TicketAddDesc}\n`;
|
|
||||||
staffCommands += `**/${cmdconfig.TicketRemove}** ${cmdconfig.TicketRemoveDesc}\n`;
|
|
||||||
|
|
||||||
const HelpEmbed1 = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.Name + " Commands")
|
|
||||||
.setThumbnail(interaction.user.displayAvatarURL())
|
|
||||||
|
|
||||||
.addFields(
|
|
||||||
{
|
|
||||||
name: "🖥️ General Commands\n",
|
|
||||||
value: `${botCommands}\n`,
|
|
||||||
inline: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "🎫 Support Commands\n",
|
|
||||||
value: `${ticketCommands}\n`,
|
|
||||||
inline: false,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter, interaction.user.displayAvatarURL());
|
|
||||||
|
|
||||||
if (interaction.member.roles.cache.has(SupportStaff.id)) {
|
|
||||||
HelpEmbed1.addFields({
|
|
||||||
name: "🔐 Staff Commands\n",
|
|
||||||
value: `${staffCommands}\n`,
|
|
||||||
inline: false,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (interaction.member.roles.cache.has(AdminStaff.id)) {
|
|
||||||
HelpEmbed1.addFields({
|
|
||||||
name: "🔐 Staff Commands\n",
|
|
||||||
value: `${staffCommands}\n`,
|
|
||||||
inline: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SendHelpPage === "dm") {
|
|
||||||
interaction.user.reply({
|
|
||||||
embeds: [HelpEmbed1],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SendHelpPage === "channel") {
|
|
||||||
interaction.reply({
|
|
||||||
embeds: [HelpEmbed1],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let ticketCommands = "";
|
||||||
|
ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`;
|
||||||
|
ticketCommands += `**/${cmdconfig.CloseTicket}** ${cmdconfig.CloseTicketDesc}\n`;
|
||||||
|
|
||||||
|
let staffCommands = "";
|
||||||
|
staffCommands += `**/${cmdconfig.TicketAdd}** ${cmdconfig.TicketAddDesc}\n`;
|
||||||
|
staffCommands += `**/${cmdconfig.TicketRemove}** ${cmdconfig.TicketRemoveDesc}\n`;
|
||||||
|
staffCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
|
||||||
|
staffCommands += `**/${cmdconfig.TranslateCommand}** ${cmdconfig.TranslateCommandDesc}\n`;
|
||||||
|
|
||||||
|
const HelpEmbed1 = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.Name + " Commands")
|
||||||
|
.setThumbnail(interaction.user.displayAvatarURL())
|
||||||
|
|
||||||
|
.addFields(
|
||||||
|
{
|
||||||
|
name: "🖥️ General Commands\n",
|
||||||
|
value: `${botCommands}\n`,
|
||||||
|
inline: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "🎫 Support Commands\n",
|
||||||
|
value: `${ticketCommands}\n`,
|
||||||
|
inline: false,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter({
|
||||||
|
text: supportbot.EmbedFooter,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
interaction.member.roles.cache.has(SupportStaff.id) ||
|
||||||
|
interaction.member.roles.cache.has(Admin.id)
|
||||||
|
) {
|
||||||
|
HelpEmbed1.addFields({
|
||||||
|
name: "🔐 Staff Commands\n",
|
||||||
|
value: `${staffCommands}\n`,
|
||||||
|
inline: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
ephemeral: true,
|
||||||
|
embeds: [HelpEmbed1],
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+2
-2
@@ -15,8 +15,8 @@ const Command = require("../Structures/Command.js");
|
|||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.InfoCommand,
|
name: cmdconfig.InfoCommand,
|
||||||
description: cmdconfig.InfoCommandDesc,
|
description: cmdconfig.InfoCommandDesc,
|
||||||
slashCommandOptions: [],
|
options: [],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const InfoButton = new Discord.MessageButton()
|
const InfoButton = new Discord.MessageButton()
|
||||||
|
|||||||
+2
-2
@@ -15,8 +15,8 @@ const Command = require("../Structures/Command.js");
|
|||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.PingCommand,
|
name: cmdconfig.PingCommand,
|
||||||
description: cmdconfig.PingCommandDesc,
|
description: cmdconfig.PingCommandDesc,
|
||||||
slashCommandOptions: [],
|
options: [],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const PingEmbed = new Discord.MessageEmbed()
|
const PingEmbed = new Discord.MessageEmbed()
|
||||||
|
|||||||
+54
-55
@@ -12,16 +12,10 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
|||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.TicketRemove,
|
name: cmdconfig.TicketRemove,
|
||||||
description: cmdconfig.TicketRemoveDesc,
|
description: cmdconfig.TicketRemoveDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "user",
|
name: "user",
|
||||||
description: "User to remove",
|
description: "User to remove",
|
||||||
@@ -29,22 +23,15 @@ module.exports = new Command({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let SupportStaff =
|
const { getRole } = interaction.client;
|
||||||
interaction.guild.roles.cache.find(
|
let Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
) ||
|
if (!Staff || !Admin)
|
||||||
interaction.guild.roles.cache.find(
|
return interaction.reply(
|
||||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
);
|
|
||||||
let Admins =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
@@ -55,41 +42,53 @@ module.exports = new Command({
|
|||||||
.setColor(supportbot.WarningColour);
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
interaction.member.roles.cache.has(SupportStaff.id) ||
|
!interaction.member.roles.cache.has(Staff.id) &&
|
||||||
interaction.member.roles.cache.has(Admins.id)
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
) {
|
)
|
||||||
if (!interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
|
||||||
const Exists = new Discord.MessageEmbed()
|
|
||||||
.setTitle("No Ticket Found!")
|
|
||||||
.setDescription(`${supportbot.NoValidTicket}`)
|
|
||||||
.setColor(supportbot.WarningColour);
|
|
||||||
return interaction.reply({ embeds: [Exists] });
|
|
||||||
}
|
|
||||||
|
|
||||||
let uMember = interaction.options.getUser("user");
|
|
||||||
const UserNotExist = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Not Found!")
|
|
||||||
.setDescription(
|
|
||||||
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketRemove} <user#0000>\``
|
|
||||||
)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.edit(uMember, {
|
|
||||||
VIEW_CHANNEL: false,
|
|
||||||
READ_MESSAGE_HISTORY: false,
|
|
||||||
SEND_MESSAGES: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const Complete = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Removed!")
|
|
||||||
.setDescription(supportbot.RemovedUser.replace(/%user%/g, uMember.id))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
interaction.reply({ embeds: [Complete] });
|
|
||||||
} else {
|
|
||||||
return interaction.reply({ embeds: [NoPerms] });
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
let TicketData = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
|
);
|
||||||
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
|
(t) => t.id === interaction.channel.id
|
||||||
|
);
|
||||||
|
if (ticket === -1) {
|
||||||
|
const Exists = new Discord.MessageEmbed()
|
||||||
|
.setTitle("No Ticket Found!")
|
||||||
|
.setDescription(supportbot.NoValidTicket)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
return interaction.reply({ ephemeral: true, embeds: [Exists] });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let uMember = interaction.options.getUser("user");
|
||||||
|
const UserNotExist = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Not Found!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketRemove} <user#0000>\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if (!uMember) return interaction.reply({ ephemeral: true, embeds: [UserNotExist] });
|
||||||
|
|
||||||
|
await interaction.channel.permissionOverwrites.edit(uMember.id, {
|
||||||
|
VIEW_CHANNEL: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const Complete = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Removed!")
|
||||||
|
.setDescription(supportbot.RemovedUser.replace(/%user%/g, uMember.id))
|
||||||
|
.setTimestamp()
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
interaction.reply({ embeds: [Complete] });
|
||||||
|
TicketData.tickets[ticket].subUsers = TicketData.tickets[
|
||||||
|
ticket
|
||||||
|
].subUsers.filter((u) => u !== uMember.id);
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+31
-15
@@ -1,5 +1,5 @@
|
|||||||
// SupportBot | Emerald Services
|
// SupportBot | Emerald Services
|
||||||
// Ping Command
|
// Suggest Command
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
@@ -15,27 +15,26 @@ const Command = require("../Structures/Command.js");
|
|||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.SuggestCommand,
|
name: cmdconfig.SuggestCommand,
|
||||||
description: cmdconfig.SuggestCommandDesc,
|
description: cmdconfig.SuggestCommandDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "suggestion",
|
name: "suggestion",
|
||||||
description: "Create a Suggestion",
|
description: "Create a Suggestion",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const suggestChannel =
|
const { getChannel } = interaction.client;
|
||||||
interaction.guild.channels.cache.find(
|
const suggestChannel = await getChannel(
|
||||||
(channel) => channel.name === supportbot.SuggestionChannel
|
supportbot.SuggestionChannel,
|
||||||
) ||
|
interaction.guild
|
||||||
interaction.guild.channels.cache.find(
|
);
|
||||||
(channel) => channel.id === supportbot.SuggestionChannel
|
|
||||||
);
|
|
||||||
|
|
||||||
const NoChannel = new Discord.MessageEmbed()
|
const NoChannel = new Discord.MessageEmbed()
|
||||||
.setTitle("Missing Channel!")
|
.setTitle("Missing Channel!")
|
||||||
.setDescription(`${supportbot.InvalidChannel}`)
|
.setDescription(supportbot.InvalidChannel)
|
||||||
.setColor(supportbot.ErrorColour);
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
if (!suggestChannel) return interaction.reply({ embeds: [NoChannel] });
|
if (!suggestChannel) return interaction.reply({ embeds: [NoChannel] });
|
||||||
@@ -46,13 +45,26 @@ module.exports = new Command({
|
|||||||
.addField("Suggestion", suggestion, true)
|
.addField("Suggestion", suggestion, true)
|
||||||
.addField("From", `<@${interaction.user.id}>`)
|
.addField("From", `<@${interaction.user.id}>`)
|
||||||
.setThumbnail(interaction.user.displayAvatarURL())
|
.setThumbnail(interaction.user.displayAvatarURL())
|
||||||
.setFooter(supportbot.EmbedFooter, interaction.user.displayAvatarURL())
|
.setFooter({
|
||||||
|
text: supportbot.EmbedFooter,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
})
|
||||||
.setColor(supportbot.EmbedColour);
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
|
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
|
||||||
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
|
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
|
||||||
suggestionMsg.react(supportbot.SuggestionUpvote);
|
await suggestionMsg.react(supportbot.SuggestionUpvote);
|
||||||
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()
|
||||||
@@ -63,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]
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+230
-258
@@ -3,7 +3,12 @@
|
|||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const {
|
||||||
|
MessageEmbed,
|
||||||
|
Permissions,
|
||||||
|
MessageButton,
|
||||||
|
MessageActionRow,
|
||||||
|
} = require("discord.js");
|
||||||
const yaml = require("js-yaml");
|
const yaml = require("js-yaml");
|
||||||
const supportbot = yaml.load(
|
const supportbot = yaml.load(
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
@@ -13,167 +18,158 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
|||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
const TicketNumberID = require("../Structures/TicketID.js");
|
const TicketNumberID = require("../Structures/TicketID.js");
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.OpenTicket,
|
name: cmdconfig.OpenTicket,
|
||||||
description: cmdconfig.OpenTicketDesc,
|
description: cmdconfig.OpenTicketDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "reason",
|
name: "reason",
|
||||||
description: "Ticket Reason",
|
description: "Ticket Reason",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let reactionUser = interaction.guild.members.cache.get(interaction.user.id);
|
let disableCommand = true;
|
||||||
|
if (interaction.isCommand() && disableCommand)
|
||||||
|
return interaction.reply({
|
||||||
|
content: "This command is disabled",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
let department = interaction.customId?.split("-")[1] || null;
|
||||||
|
let TicketData = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
|
);
|
||||||
|
const { getRole, getCategory } = interaction.client;
|
||||||
|
let User = interaction.guild.members.cache.get(interaction.user.id);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
reactionUser.roles.cache.find(
|
supportbot.MaxAllowedTickets &&
|
||||||
(role) => role.name === supportbot.TicketBlackListRole
|
TicketData.tickets.filter((t) => t.user === interaction.user.id && t.open)
|
||||||
) ||
|
.length >= supportbot.MaxAllowedTickets
|
||||||
reactionUser.roles.cache.find(
|
) {
|
||||||
(role) => role.id === supportbot.TicketBlackListRole
|
return interaction.reply({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
title: "Too Many Tickets!",
|
||||||
|
description: `You can't have more than ${supportbot.MaxAllowedTickets} open tickets!`,
|
||||||
|
color: supportbot.WarningColour,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
User.roles.cache.has(
|
||||||
|
getRole(supportbot.TicketBlackListRole, interaction.guild).id
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return interaction
|
return interaction.reply({
|
||||||
.reply({
|
content: supportbot.TicketBlackListMessage,
|
||||||
content: `<@${interaction.user.id}> ${supportbot.TicketBlackListMessage}`,
|
ephemeral: true,
|
||||||
})
|
});
|
||||||
.then((msg) => {
|
|
||||||
setTimeout(() => msg.delete(), 3500);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ticket ID
|
// Ticket ID
|
||||||
let ticketNumberID = TicketNumberID.pad(interaction.guild.id);
|
let ticketNumberID = await TicketNumberID.pad();
|
||||||
|
|
||||||
// Ticket Subject
|
// Ticket Subject
|
||||||
const TicketSubject =
|
const TicketSubject =
|
||||||
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
|
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
|
||||||
|
|
||||||
const TicketExists = new Discord.MessageEmbed()
|
const TicketExists = new MessageEmbed()
|
||||||
.setTitle("Ticket Exists!")
|
.setTitle("Ticket Exists!")
|
||||||
.setDescription(`${supportbot.TicketExists}`)
|
.setDescription(supportbot.TicketExists);
|
||||||
.setColor(supportbot.WarningColour);
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
await interaction.guild.channels.cache.find((ticketChannel) => {
|
await interaction.guild.channels.cache.find(
|
||||||
ticketChannel.name === `${supportbot.TicketPrefix}${ticketNumberID}`;
|
(ticketChannel) =>
|
||||||
})
|
ticketChannel.name === `${supportbot.TicketPrefix}${ticketNumberID}`
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
return interaction.reply({ embeds: [TicketExists] });
|
return await interaction.reply({
|
||||||
|
embeds: [TicketExists],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
const Staff =
|
const Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
interaction.guild.roles.cache.find(
|
const Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
if (!Staff || !Admin)
|
||||||
) ||
|
return interaction.reply({
|
||||||
interaction.guild.roles.cache.find(
|
content:
|
||||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot.",
|
||||||
);
|
ephemeral: true,
|
||||||
const Admins =
|
});
|
||||||
interaction.guild.roles.cache.find(
|
let TicketCategory = await getCategory(
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
supportbot.Departments[department].category,
|
||||||
) ||
|
interaction.guild
|
||||||
interaction.guild.roles.cache.find(
|
);
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
|
||||||
);
|
|
||||||
const DeptRole1 =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.name === `${supportbot.DepartmentRole_1}`
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.id === `${supportbot.DepartmentRole_1}`
|
|
||||||
);
|
|
||||||
const DeptRole2 =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.name === `${supportbot.DepartmentRole_2}`
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.id === `${supportbot.DepartmentRole_2}`
|
|
||||||
);
|
|
||||||
const DeptRole3 =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.name === `${supportbot.DepartmentRole_3}`
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.id === `${supportbot.DepartmentRole_3}`
|
|
||||||
);
|
|
||||||
const Author = interaction.user;
|
|
||||||
const Everyone = interaction.guild.id;
|
|
||||||
const ticketChannel = await interaction.guild.channels.create(
|
const ticketChannel = await interaction.guild.channels.create(
|
||||||
`${supportbot.TicketPrefix}${ticketNumberID}`,
|
`${supportbot.TicketPrefix}${ticketNumberID}`,
|
||||||
{
|
{
|
||||||
type: "GUILD_TEXT",
|
type: "GUILD_TEXT",
|
||||||
|
parent: TicketCategory.id,
|
||||||
|
permissionOverwrites: [
|
||||||
|
{
|
||||||
|
id: Admin.id,
|
||||||
|
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: interaction.user.id,
|
||||||
|
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: interaction.guild.id,
|
||||||
|
deny: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (supportbot.AllowAllStaff) {
|
||||||
|
await ticketChannel.permissionOverwrites.edit(Staff.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!department) {
|
||||||
|
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
|
SEND_MESSAGES: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await TicketData.tickets.push({
|
||||||
|
id: ticketChannel.id,
|
||||||
|
name: ticketChannel.name,
|
||||||
|
user: interaction.user.id,
|
||||||
|
number: ticketNumberID,
|
||||||
|
reason: TicketSubject,
|
||||||
|
open: true,
|
||||||
|
subUsers: [],
|
||||||
|
});
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
const CreatedTicket = new MessageEmbed()
|
||||||
interaction.channel.name === supportbot.ReactionChannel ||
|
.setDescription(
|
||||||
interaction.channel.id === supportbot.ReactionChannel
|
supportbot.TicketCreatedAlert.replace(
|
||||||
) {
|
/%ticketauthor%/g,
|
||||||
const CreatedTicket = new Discord.MessageEmbed()
|
interaction.user.id
|
||||||
.setDescription(
|
|
||||||
supportbot.TicketCreatedAlert.replace(
|
|
||||||
/%ticketauthor%/g,
|
|
||||||
interaction.user.id
|
|
||||||
)
|
|
||||||
.replace(/%ticketid%/g, ticketChannel.id)
|
|
||||||
.replace(/%ticketusername%/g, interaction.user.username)
|
|
||||||
)
|
)
|
||||||
.setColor(supportbot.EmbedColour);
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
.replace(/%ticketusername%/g, interaction.user.username)
|
||||||
} else {
|
)
|
||||||
const CreatedTicket = new Discord.MessageEmbed()
|
.setColor(supportbot.EmbedColour);
|
||||||
.setDescription(
|
await interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
||||||
supportbot.TicketCreatedAlert.replace(
|
|
||||||
/%ticketauthor%/g,
|
|
||||||
interaction.user.id
|
|
||||||
)
|
|
||||||
.replace(/%ticketid%/g, ticketChannel.id)
|
|
||||||
.replace(/%ticketusername%/g, interaction.user.username)
|
|
||||||
)
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
|
||||||
}
|
|
||||||
let AllowArr = [Staff, Staff, Admins, Author];
|
|
||||||
await asyncForEach(AllowArr, (index) => {
|
|
||||||
ticketChannel.permissionOverwrites.create(index, { VIEW_CHANNEL: true });
|
|
||||||
});
|
|
||||||
|
|
||||||
let DenyArr = [Everyone];
|
|
||||||
await asyncForEach(DenyArr, (index) => {
|
|
||||||
ticketChannel.permissionOverwrites.create(index, { VIEW_CHANNEL: false });
|
|
||||||
});
|
|
||||||
|
|
||||||
let TicketCategory =
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(category) => category.name === supportbot.TicketCategory
|
|
||||||
) ||
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(category) => category.id === supportbot.TicketCategory
|
|
||||||
);
|
|
||||||
if (TicketCategory) {
|
|
||||||
ticketChannel.setParent(TicketCategory.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.AllowTicketMentions) {
|
if (supportbot.AllowTicketMentions) {
|
||||||
ticketChannel.send({ content: `${interaction.user}` });
|
await ticketChannel.send(`${interaction.user}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const TicketMessage = new Discord.MessageEmbed()
|
const TicketMessage = new MessageEmbed()
|
||||||
.setTitle(
|
.setTitle(
|
||||||
supportbot.Ticket_Title.replace(/%ticketauthor%/g, interaction.user.id)
|
supportbot.Ticket_Title.replace(/%ticketauthor%/g, interaction.user.id)
|
||||||
.replace(/%ticketid%/g, ticketChannel.id)
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
@@ -187,176 +183,152 @@ module.exports = new Command({
|
|||||||
.setColor(supportbot.EmbedColour);
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
if (supportbot.TicketSubject === "embed") {
|
if (supportbot.TicketSubject === "embed") {
|
||||||
if (TicketSubject != "No Reason Provided.") {
|
if (TicketSubject !== "No Reason Provided.") {
|
||||||
TicketMessage.addFields({ name: "Reason", value: TicketSubject });
|
TicketMessage.addFields({ name: "Reason", value: TicketSubject });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (supportbot.TicketSubject === "description") {
|
if (supportbot.TicketSubject === "description") {
|
||||||
if (TicketSubject != "No Reason Provided.") {
|
if (TicketSubject !== "No Reason Provided.") {
|
||||||
ticketChannel.setTopic(
|
await ticketChannel.setTopic(
|
||||||
`Reason: ${TicketSubject} - User ID: ${interaction.user.id} - Ticket: ${ticketChannel.name}`
|
`Reason: ${TicketSubject} - User ID: ${interaction.user.id} - Ticket: ${ticketChannel.name}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (supportbot.TicketDepartments) {
|
if (!department) {
|
||||||
TicketMessage.addFields({
|
TicketMessage.addFields({
|
||||||
name: "Departments",
|
name: "Departments",
|
||||||
value: ` **${supportbot.DepartmentTitle_1}**\n **${supportbot.DepartmentTitle_2}**\n **${supportbot.DepartmentTitle_3}**`,
|
value: ` **${supportbot.Departments.map((X) => X.title).join("\n")}**`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const CloseButton = new Discord.MessageButton()
|
const CloseButton = new MessageButton()
|
||||||
.setCustomId("ticketclose")
|
.setCustomId("ticketclose")
|
||||||
.setLabel("Close")
|
.setLabel("Close")
|
||||||
.setStyle(supportbot.TicketCloseColour)
|
.setStyle(supportbot.TicketCloseColour)
|
||||||
.setEmoji(supportbot.TicketCloseEmoji);
|
.setEmoji(supportbot.TicketCloseEmoji);
|
||||||
|
|
||||||
const LockButton = new Discord.MessageButton()
|
const LockButton = new MessageButton()
|
||||||
.setCustomId("ticketlock")
|
.setCustomId("ticketlock")
|
||||||
.setLabel("Lock")
|
.setLabel("Lock")
|
||||||
.setStyle(supportbot.TicketLockColour)
|
.setStyle(supportbot.TicketLockColour)
|
||||||
.setEmoji(supportbot.TicketLockEmoji);
|
.setEmoji(supportbot.TicketLockEmoji);
|
||||||
|
const ClaimButton = new MessageButton()
|
||||||
|
.setCustomId("ticketclaim")
|
||||||
|
.setLabel("Claim")
|
||||||
|
.setStyle(supportbot.TicketClaimColour)
|
||||||
|
.setEmoji(supportbot.TicketClaimEmoji);
|
||||||
|
|
||||||
const row2 = new Discord.MessageActionRow().addComponents(
|
const row2 = new MessageActionRow().addComponents(CloseButton, LockButton, ClaimButton);
|
||||||
CloseButton,
|
if (!department) {
|
||||||
LockButton
|
try {
|
||||||
);
|
let buttons = await supportbot.Departments.map((x) =>
|
||||||
|
new MessageButton()
|
||||||
if (supportbot.TicketDepartments) {
|
.setCustomId("Department" + supportbot.Departments.indexOf(x))
|
||||||
let DenyArr = [DeptRole1, DeptRole2, DeptRole3];
|
.setLabel(x.title)
|
||||||
await asyncForEach(DenyArr, (index) => {
|
.setStyle(x.color)
|
||||||
ticketChannel.permissionOverwrites.create(index, {
|
.setEmoji(x.emoji)
|
||||||
VIEW_CHANNEL: false,
|
);
|
||||||
|
const row = new MessageActionRow().addComponents(buttons);
|
||||||
|
const m = await ticketChannel.send({
|
||||||
|
embeds: [TicketMessage],
|
||||||
|
components: [row],
|
||||||
});
|
});
|
||||||
});
|
|
||||||
const Department1Button = new Discord.MessageButton()
|
|
||||||
.setCustomId("Department1")
|
|
||||||
.setLabel(`${supportbot.DepartmentTitle_1}`)
|
|
||||||
.setStyle(supportbot.TicketDept1Colour)
|
|
||||||
.setEmoji(supportbot.TicketDept1Emoji);
|
|
||||||
|
|
||||||
const Department2Button = new Discord.MessageButton()
|
let collector;
|
||||||
.setCustomId("Department2")
|
try {
|
||||||
.setLabel(`${supportbot.DepartmentTitle_2}`)
|
const filter = (i) => i.user.id === interaction.user.id;
|
||||||
.setStyle(supportbot.TicketDept2Colour)
|
collector = await m.awaitMessageComponent({
|
||||||
.setEmoji(supportbot.TicketDept2Emoji);
|
filter,
|
||||||
|
max: 1,
|
||||||
const Department3Button = new Discord.MessageButton()
|
componentType: "BUTTON",
|
||||||
.setCustomId("Department3")
|
time: supportbot.Timeout * 60000,
|
||||||
.setLabel(`${supportbot.DepartmentTitle_3}`)
|
|
||||||
.setStyle(supportbot.TicketDept3Colour)
|
|
||||||
.setEmoji(supportbot.TicketDept3Emoji);
|
|
||||||
|
|
||||||
const row = new Discord.MessageActionRow().addComponents(
|
|
||||||
Department1Button,
|
|
||||||
Department2Button,
|
|
||||||
Department3Button
|
|
||||||
);
|
|
||||||
|
|
||||||
const m = await ticketChannel.send({
|
|
||||||
embeds: [TicketMessage],
|
|
||||||
components: [row],
|
|
||||||
});
|
|
||||||
|
|
||||||
const filter = (i) => {
|
|
||||||
i.deferUpdate();
|
|
||||||
return i.user.id === interaction.user.id;
|
|
||||||
};
|
|
||||||
const collector = m.createMessageComponentCollector({
|
|
||||||
filter,
|
|
||||||
max: 1,
|
|
||||||
componentType: "BUTTON",
|
|
||||||
time: 60000,
|
|
||||||
});
|
|
||||||
|
|
||||||
collector.on("collect", async (i) => {
|
|
||||||
if (i.customId === "Department1") {
|
|
||||||
ticketChannel.permissionOverwrites.edit(DeptRole1, {
|
|
||||||
VIEW_CHANNEL: true,
|
|
||||||
READ_MESSAGE_HISTORY: true,
|
|
||||||
SEND_MESSAGES: true,
|
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
if (!supportbot.AllowStaff) {
|
if (e.code === "INTERACTION_COLLECTOR_ERROR") {
|
||||||
ticketChannel.permissionOverwrites.edit(Staff, {
|
try {
|
||||||
VIEW_CHANNEL: false,
|
TicketData = await JSON.parse(
|
||||||
READ_MESSAGE_HISTORY: false,
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
SEND_MESSAGES: false,
|
);
|
||||||
});
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
}
|
(t) => t.id === ticketChannel.id
|
||||||
|
);
|
||||||
const Department1 = new Discord.MessageEmbed()
|
TicketData.tickets[ticket].open = false;
|
||||||
.setDescription(
|
fs.writeFileSync(
|
||||||
`> Thank for reaching out to the **${supportbot.DepartmentTitle_1} Department**. Please provide us information regarding your query.`
|
"./Data/TicketData.json",
|
||||||
)
|
JSON.stringify(TicketData, null, 4),
|
||||||
.setColor(supportbot.EmbedColour);
|
(err) => {
|
||||||
ticketChannel.send({ embeds: [Department1] });
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
if (supportbot.AllowTicketMentions) {
|
);
|
||||||
ticketChannel.send({ content: `@here` });
|
interaction.user.send(
|
||||||
|
"Your ticket has timed out. Please open a new one, and select a department."
|
||||||
|
);
|
||||||
|
} catch (e) {}
|
||||||
|
return await ticketChannel.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i.message.edit({ embeds: [TicketMessage], components: [row2] });
|
let num = collector.customId.split("Department")[1];
|
||||||
|
let role = getRole(supportbot.Departments[num].role, interaction.guild);
|
||||||
|
let title = supportbot.Departments[num].title;
|
||||||
|
|
||||||
if (i.customId === "Department2") {
|
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||||
ticketChannel.permissionOverwrites.edit(DeptRole2, {
|
VIEW_CHANNEL: true,
|
||||||
VIEW_CHANNEL: true,
|
});
|
||||||
READ_MESSAGE_HISTORY: true,
|
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
SEND_MESSAGES: true,
|
SEND_MESSAGES: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!supportbot.AllowStaff) {
|
await collector.reply({
|
||||||
ticketChannel.permissionOverwrites.edit(Staff, {
|
embeds: [
|
||||||
VIEW_CHANNEL: false,
|
{
|
||||||
READ_MESSAGE_HISTORY: false,
|
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
|
||||||
SEND_MESSAGES: false,
|
color: supportbot.EmbedColour,
|
||||||
});
|
},
|
||||||
}
|
],
|
||||||
|
});
|
||||||
|
|
||||||
const Department2 = new Discord.MessageEmbed()
|
if (supportbot.AllowTicketMentions) {
|
||||||
.setDescription(
|
await ticketChannel.send("@here");
|
||||||
`> Thank for reaching out to the **${supportbot.DepartmentTitle_2} Department**. Please provide us information regarding your query.`
|
|
||||||
)
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
ticketChannel.send({ embeds: [Department2] });
|
|
||||||
|
|
||||||
if (supportbot.AllowTicketMentions) {
|
|
||||||
ticketChannel.send({ content: `@here` });
|
|
||||||
}
|
|
||||||
|
|
||||||
i.message.edit({ embeds: [TicketMessage], components: [row2] });
|
|
||||||
}
|
}
|
||||||
if (i.customId === "Department3") {
|
await collector.message.edit({
|
||||||
ticketChannel.permissionOverwrites.edit(DeptRole3, {
|
embeds: [TicketMessage],
|
||||||
VIEW_CHANNEL: true,
|
components: [row2],
|
||||||
READ_MESSAGE_HISTORY: true,
|
});
|
||||||
SEND_MESSAGES: true,
|
} catch (error) {}
|
||||||
});
|
|
||||||
|
|
||||||
if (!supportbot.AllowStaff) {
|
|
||||||
ticketChannel.permissionOverwrites.edit(Staff, {
|
|
||||||
VIEW_CHANNEL: false,
|
|
||||||
READ_MESSAGE_HISTORY: false,
|
|
||||||
SEND_MESSAGES: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const Department3 = new Discord.MessageEmbed()
|
|
||||||
.setDescription(
|
|
||||||
`> Thank for reaching out to the **${supportbot.DepartmentTitle_3} Department**. Please provide us information regarding your query.`
|
|
||||||
)
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
ticketChannel.send({ embeds: [Department3] });
|
|
||||||
|
|
||||||
if (supportbot.AllowTicketMentions) {
|
|
||||||
ticketChannel.send({ content: `@here` });
|
|
||||||
}
|
|
||||||
i.message.edit({ embeds: [TicketMessage], components: [row2] });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ticketChannel.send({ embeds: [TicketMessage], components: [row2] });
|
await ticketChannel.send({
|
||||||
|
embeds: [TicketMessage],
|
||||||
|
components: [row2],
|
||||||
|
});
|
||||||
|
if (department) {
|
||||||
|
let role = await getRole(
|
||||||
|
supportbot.Departments[department].role,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
let title = supportbot.Departments[department].title;
|
||||||
|
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
let TicketCat = await getCategory(
|
||||||
|
supportbot.Departments[department].category,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
await ticketChannel.setParent(TicketCat.id, { lockPermissions: false });
|
||||||
|
if (supportbot.AllowThanksForReachingOutMessage) {
|
||||||
|
await ticketChannel.send({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
|
||||||
|
color: supportbot.EmbedColour,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (supportbot.AllowTicketMentions) {
|
||||||
|
await ticketChannel.send(supportbot.TicketRoleMention);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -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] });
|
||||||
|
},
|
||||||
|
|
||||||
|
})
|
||||||
@@ -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/
|
||||||
|
**/
|
||||||
@@ -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."
|
||||||
+144
-69
@@ -10,21 +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.3.1"
|
SupportBot_Version: "v7.7.3"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# General Configuration
|
# General Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
Name: "SupportBot"
|
Name: "SupportBot"
|
||||||
# No Prefix, as everything uses the new Slash (/) Commands feature!
|
Token: "BOT_TOKEN HTTPS://DISCORD.COM/DEVELOPERS"
|
||||||
Token: "BOT_TOKEN"
|
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# 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!
|
||||||
@@ -37,42 +36,74 @@ 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
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
HelpMenu: true # Do not change!
|
|
||||||
SendHelpPage: "channel" # Set to channel or dm
|
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Role Configuration
|
# Role Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
AutoRole: true
|
AutoRole: true
|
||||||
AutoRole_Role: "Member"
|
JoinRole: "SupportBot Member"
|
||||||
LockdownRole: "@everyone"
|
|
||||||
|
|
||||||
Staff: "Staff"
|
Staff: "SupportBot Staff"
|
||||||
Admin: "Admin"
|
Admin: "SupportBot 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"
|
||||||
|
AboutMe: "I am SupportBot"
|
||||||
|
InfoURL: "https://emeraldsrv.dev"
|
||||||
|
InfoColour: "#f74343"
|
||||||
|
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Suggestions Configuration
|
# Suggestions Configuration
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
@@ -81,27 +112,53 @@ 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"
|
|
||||||
TicketPrefix: "ticket-" # The prefix for ticket channel names
|
TicketPrefix: "ticket-" # The prefix for ticket channel names
|
||||||
|
|
||||||
TicketLog: "logs"
|
TicketLog: "ticket-data"
|
||||||
TranscriptLog: "transcripts"
|
TranscriptLog: "ticket-data"
|
||||||
|
|
||||||
|
DMTranscripts: true
|
||||||
TranscriptTitle: "Ticket Transcript"
|
TranscriptTitle: "Ticket Transcript"
|
||||||
TicketLog_Title: "Ticket Log"
|
TicketLog_Title: "Ticket Closed"
|
||||||
TicketBlackListMessage: "You are not allowed to open a ticket"
|
TicketBlackListMessage: "You are not allowed to open a ticket"
|
||||||
|
TicketRoleMention: "@here"
|
||||||
|
TicketClaimMessage: "Your ticket will be handled by" #Automaticly tags user to the end
|
||||||
|
TicketClaimTitle: "Ticket Claimed"
|
||||||
|
TicketUnclaimMessage: "Your ticket is now unclaimed by" #Automaticly tags user to the end
|
||||||
|
TicketUnclaimTitle: "Ticket Unclaimed"
|
||||||
|
# To ping a role: <@ROLE_ID>
|
||||||
|
|
||||||
|
MaxAllowedTickets: 2
|
||||||
|
|
||||||
TicketSubject: "description"
|
TicketSubject: "description"
|
||||||
# "description" will displays the ticket reason within the channel description
|
# "description" will display the ticket reason within the channel description
|
||||||
# "embed" will displays the ticket reason within the ticket embed
|
# "embed" will display the ticket reason within the ticket embed
|
||||||
|
|
||||||
AllowTicketMentions: true
|
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 to 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,67 +180,85 @@ 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: "SupportBot Staff"
|
||||||
|
color: "SECONDARY"
|
||||||
|
emoji: "1️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
|
||||||
|
- title: "Billing Support"
|
||||||
|
role: "SupportBot Staff"
|
||||||
|
color: "SECONDARY"
|
||||||
|
emoji: "2️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
|
||||||
|
- title: "Admin Team"
|
||||||
|
role: "SupportBot 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 - Blurple
|
# PRIMARY - Blurple
|
||||||
|
# SECONDARY - Grey
|
||||||
# DANGER - Red
|
# DANGER - Red
|
||||||
# SUCCESS - Green
|
# SUCCESS - Green
|
||||||
# Secondary - Grey
|
|
||||||
|
|
||||||
TicketLockReaction: "🔒"
|
# --- Buttons Config ---
|
||||||
TicketDeleteReaction: "⛔"
|
# --- Start ---
|
||||||
|
|
||||||
LockTicketCategory: "Archive"
|
LockTicketCategory: "Archive"
|
||||||
|
UnlockTicketCategory: "Tickets" #This moves the ticket back to the main category.
|
||||||
|
|
||||||
TicketCloseEmoji: "❌"
|
TicketCloseEmoji: "❌"
|
||||||
TicketDeleteEmoji: "⛔"
|
TicketDeleteEmoji: "⛔"
|
||||||
TicketLockEmoji: "🔒"
|
TicketLockEmoji: "🔒"
|
||||||
|
TicketClaimEmoji: "🧑💻"
|
||||||
|
TicketUnlockEmoji: "🔓"
|
||||||
|
TicketUnclaimEmoji: "🧑💻"
|
||||||
|
|
||||||
TicketCloseColour: "DANGER"
|
TicketCloseColour: "DANGER"
|
||||||
TicketDeleteColour: "DANGER"
|
TicketDeleteColour: "DANGER"
|
||||||
TicketLockColour: "PRIMARY"
|
TicketLockColour: "PRIMARY"
|
||||||
|
TicketClaimColour: "SUCCESS"
|
||||||
|
TicketUnclaimColour: "DANGER"
|
||||||
|
TicketUnlockColour: "SUCCES"
|
||||||
|
|
||||||
TicketDept1Colour: "PRIMARY"
|
# Discord Button Colour Selection
|
||||||
TicketDept2Colour: "PRIMARY"
|
# PRIMARY - Blue
|
||||||
TicketDept3Colour: "PRIMARY"
|
# SECONDARY - Grey
|
||||||
|
# DANGER - Red
|
||||||
TicketDept1Emoji: "1️⃣"
|
# SUCCESS - Green
|
||||||
TicketDept2Emoji: "2️⃣"
|
|
||||||
TicketDept3Emoji: "3️⃣"
|
|
||||||
|
|
||||||
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.
|
||||||
TicketDeleteTime: 5000 # Time must be set in milliseconds.
|
|
||||||
|
|
||||||
# --- Departments Config ---
|
|
||||||
# --- Start ---
|
|
||||||
|
|
||||||
TicketDepartments: true
|
|
||||||
|
|
||||||
AllowStaff: true
|
|
||||||
# If set to false users with the "Staff" role will not be able to view tickets
|
|
||||||
# without a valid department role set below.
|
|
||||||
|
|
||||||
# Set to false to allow "Staff" to see tickets whether its a department for them or not.
|
|
||||||
|
|
||||||
DepartmentTitle_1: "General Support"
|
|
||||||
DepartmentTitle_2: "Billing Support"
|
|
||||||
DepartmentTitle_3: "Admin Team"
|
|
||||||
# Ticket department title, This is the title for a ticket department to help users know what is available.
|
|
||||||
|
|
||||||
DepartmentRole_1: "Support"
|
|
||||||
DepartmentRole_2: "Support"
|
|
||||||
DepartmentRole_3: "Admin"
|
|
||||||
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been chosen.
|
|
||||||
|
|
||||||
# --- Closing Config ---
|
# --- Closing Config ---
|
||||||
# --- Start ---
|
# --- Start ---
|
||||||
|
|
||||||
|
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
|
||||||
|
|||||||
@@ -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 - Blurple
|
|
||||||
# -> 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,5 +1 @@
|
|||||||
{
|
{"tickets": [{}]}
|
||||||
"854057237495676938": {
|
|
||||||
"id": 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"TicketPanelID": ""
|
"id": 0,
|
||||||
}
|
"TicketPanelID": ""
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
module.exports = new Event("guildCreate", async (client) => {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`${client.user.username} is not in the correct server set in your config. Please leave all other servers and restart the bot.`
|
||||||
|
);
|
||||||
|
console.log(`\u001b[31m`, `${client.user.username} will now exit.`);
|
||||||
|
return process.exit(1);
|
||||||
|
});
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
|
module.exports = new Event("guildDelete", async (client) => {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`${client.user.username} is not in the correct server set in your config. Please join the server and restart the bot.`
|
||||||
|
);
|
||||||
|
console.log(`\u001b[31m`, `${client.user.username} will now exit.`);
|
||||||
|
return process.exit(1);
|
||||||
|
});
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
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("guildMemberAdd", async (client, member, interaction, guild) => {
|
||||||
|
|
||||||
|
if (supportbot.Welcome) {
|
||||||
|
const WelcomeChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.WelcomeChannel)
|
||||||
|
|
||||||
|
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!`)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
@@ -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!`)
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
+237
-88
@@ -11,15 +11,17 @@ const supportbot = yaml.load(
|
|||||||
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
const Event = require("../Structures/Event.js");
|
const Event = require("../Structures/Event.js");
|
||||||
|
const TicketNumberID = require("../Structures/TicketID.js");
|
||||||
|
|
||||||
module.exports = new Event("interactionCreate", (client, interaction) => {
|
|
||||||
|
|
||||||
|
module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||||
if (interaction.isCommand()) {
|
if (interaction.isCommand()) {
|
||||||
const command = client.commands.find(
|
const command = client.commands.find(
|
||||||
(cmd) => cmd.name.toLowerCase() == interaction.commandName
|
(cmd) => cmd.name.toLowerCase() === interaction.commandName
|
||||||
);
|
);
|
||||||
|
|
||||||
if (interaction.user.bot || !interaction.isCommand() || !interaction.guild)
|
if (interaction.user.bot || !interaction.guild) return;
|
||||||
return;
|
|
||||||
|
|
||||||
const NotValid = new Discord.MessageEmbed()
|
const NotValid = new Discord.MessageEmbed()
|
||||||
.setDescription(`:x: \`Invalid Command\` `)
|
.setDescription(`:x: \`Invalid Command\` `)
|
||||||
@@ -30,7 +32,7 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
embeds: [NotValid],
|
embeds: [NotValid],
|
||||||
});
|
});
|
||||||
|
|
||||||
const permission = interaction.member.permissions.has(command.permission);
|
const permission = interaction.member.permissions.has(command.permissions);
|
||||||
|
|
||||||
const ValidPerms = new Discord.MessageEmbed()
|
const ValidPerms = new Discord.MessageEmbed()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
@@ -42,11 +44,13 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
embeds: [ValidPerms],
|
embeds: [ValidPerms],
|
||||||
});
|
});
|
||||||
interaction.user = interaction.user;
|
|
||||||
command.run(interaction);
|
command.run(interaction);
|
||||||
}
|
}
|
||||||
if (interaction.isButton()) {
|
if (interaction.isButton()) {
|
||||||
if (interaction.customId === "openticket") {
|
if (
|
||||||
|
interaction.customId === "openticket" ||
|
||||||
|
interaction.customId.includes("department-")
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
const cmd = client.commands.get(cmdconfig.OpenTicket);
|
const cmd = client.commands.get(cmdconfig.OpenTicket);
|
||||||
if (!cmd) return;
|
if (!cmd) return;
|
||||||
@@ -57,79 +61,17 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (interaction.customId === "ticketclose") {
|
if (interaction.customId === "ticketclose") {
|
||||||
if (interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
try {
|
||||||
interaction.message.fetch();
|
const cmd = client.commands.get(cmdconfig.CloseTicket);
|
||||||
interaction.deferUpdate();
|
if (!cmd) return;
|
||||||
const DeleteTicketEmbed = new Discord.MessageEmbed()
|
cmd.run(interaction);
|
||||||
.setDescription(supportbot.TicketDeleteMessage)
|
} catch (error) {
|
||||||
.setColor(supportbot.EmbedColour);
|
console.error(error);
|
||||||
interaction.channel.send({ embeds: [DeleteTicketEmbed] });
|
|
||||||
|
|
||||||
let logChannel =
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(channel) => channel.name === supportbot.TranscriptLog
|
|
||||||
) ||
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(channel) => channel.id === supportbot.TranscriptLog
|
|
||||||
);
|
|
||||||
|
|
||||||
let user = interaction.user;
|
|
||||||
let name = interaction.channel.name;
|
|
||||||
let ticketChannel = interaction.channel;
|
|
||||||
let reason = "No Reason Provided.";
|
|
||||||
|
|
||||||
interaction.channel
|
|
||||||
.send({ content: `**${supportbot.ClosingTicket}**` })
|
|
||||||
.then(() => {
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Closed By", user.username)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
interaction.channel.messages.fetch({ limit: 100 }).then((msgs) => {
|
|
||||||
let html = "";
|
|
||||||
|
|
||||||
msgs = msgs.sort(
|
|
||||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
|
||||||
);
|
|
||||||
html += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
|
||||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
|
||||||
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
|
||||||
|
|
||||||
msgs.forEach((msg) => {
|
|
||||||
if (msg.content) {
|
|
||||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
|
||||||
html += `-----<br><br>`;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const TranscriptSavedEmbed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(supportbot.TranscriptSavedMessage)
|
|
||||||
.setColor(supportbot.SuccessColour);
|
|
||||||
interaction.channel.send({ embeds: [TranscriptSavedEmbed] });
|
|
||||||
|
|
||||||
let file = new Discord.MessageAttachment(
|
|
||||||
Buffer.from(html),
|
|
||||||
`${name}.html`
|
|
||||||
);
|
|
||||||
logChannel.send({ embeds: [logEmbed], files: [file] });
|
|
||||||
|
|
||||||
setTimeout(
|
|
||||||
() => interaction.channel.delete(),
|
|
||||||
supportbot.TicketDeleteTime
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (interaction.customId === "ticketlock") {
|
if (interaction.customId === "ticketlock") {
|
||||||
if (interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
if (interaction.channel.name.startsWith(supportbot.TicketPrefix)) {
|
||||||
interaction.message.fetch();
|
interaction.message.fetch();
|
||||||
interaction.deferUpdate();
|
|
||||||
let Admin =
|
let Admin =
|
||||||
interaction.guild.roles.cache.find(
|
interaction.guild.roles.cache.find(
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||||
@@ -137,29 +79,38 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
interaction.guild.roles.cache.find(
|
interaction.guild.roles.cache.find(
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||||
);
|
);
|
||||||
|
if (!interaction.member.roles.cache.has(Admin.id)) {
|
||||||
|
return await interaction.reply({
|
||||||
|
content: "You don't have permission to do that.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
let all = interaction.channel.permissionOverwrites.cache;
|
let all = interaction.channel.permissionOverwrites.cache;
|
||||||
|
|
||||||
let parent =
|
let parent =
|
||||||
interaction.guild.channels.cache.find(
|
interaction.guild.channels.cache.find(
|
||||||
(c) => c.name === `${supportbot.LockTicketCategory}`
|
(c) => c.name === supportbot.LockTicketCategory
|
||||||
) ||
|
) ||
|
||||||
interaction.guild.channels.cache.find(
|
interaction.guild.channels.cache.find(
|
||||||
(c) => c.id === `${supportbot.LockTicketCategory}`
|
(c) => c.id === supportbot.LockTicketCategory
|
||||||
);
|
);
|
||||||
if (parent) {
|
if (parent) {
|
||||||
interaction.channel.setParent(parent.id);
|
await interaction.channel.setParent(parent.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
all.forEach((perm) => {
|
all.forEach((perm) => {
|
||||||
interaction.channel.permissionOverwrites.delete(perm.id);
|
interaction.channel.permissionOverwrites.delete(perm.id);
|
||||||
});
|
});
|
||||||
interaction.channel.permissionOverwrites.create(Admin.id, {
|
await interaction.channel.permissionOverwrites.create(Admin.id, {
|
||||||
VIEW_CHANNEL: true,
|
VIEW_CHANNEL: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.create(interaction.guild.id, {
|
await interaction.channel.permissionOverwrites.create(
|
||||||
VIEW_CHANNEL: false,
|
interaction.guild.id,
|
||||||
});
|
{
|
||||||
|
VIEW_CHANNEL: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const ticketDeleteButton = new Discord.MessageButton()
|
const ticketDeleteButton = new Discord.MessageButton()
|
||||||
.setCustomId("ticketclose")
|
.setCustomId("ticketclose")
|
||||||
@@ -167,17 +118,215 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
.setStyle(supportbot.TicketDeleteColour)
|
.setStyle(supportbot.TicketDeleteColour)
|
||||||
.setEmoji(supportbot.TicketDeleteEmoji);
|
.setEmoji(supportbot.TicketDeleteEmoji);
|
||||||
|
|
||||||
|
const ticketUnlockButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketunlock")
|
||||||
|
.setLabel("Unlock")
|
||||||
|
.setStyle(supportbot.TicketUnlockColour)
|
||||||
|
.setEmoji(supportbot.TicketUnlockEmoji);
|
||||||
|
|
||||||
const row = new Discord.MessageActionRow().addComponents(
|
const row = new Discord.MessageActionRow().addComponents(
|
||||||
ticketDeleteButton
|
ticketDeleteButton, ticketUnlockButton
|
||||||
);
|
);
|
||||||
const ArchiveEmbed = new Discord.MessageEmbed()
|
const ArchiveEmbed = new Discord.MessageEmbed()
|
||||||
.setTitle("Archived")
|
.setTitle("Archived")
|
||||||
.setDescription(`Archived ${interaction.channel.name}`)
|
.setDescription(`Archived ${interaction.channel.name}`)
|
||||||
.setColor(`${supportbot.SuccessColour}`);
|
.setColor(supportbot.SuccessColour);
|
||||||
|
|
||||||
interaction.channel.send({ embeds: [ArchiveEmbed] });
|
interaction.reply({ embeds: [ArchiveEmbed] });
|
||||||
interaction.message.edit({ components: [row] });
|
interaction.message.edit({ components: [row] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (interaction.customId === "ticketunlock") {
|
||||||
});
|
if (interaction.channel.name.startsWith(supportbot.TicketPrefix)) {
|
||||||
|
interaction.message.fetch();
|
||||||
|
let Admin =
|
||||||
|
interaction.guild.roles.cache.find(
|
||||||
|
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||||
|
) ||
|
||||||
|
interaction.guild.roles.cache.find(
|
||||||
|
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||||
|
);
|
||||||
|
if (!interaction.member.roles.cache.has(Admin.id)) {
|
||||||
|
return await interaction.reply({
|
||||||
|
content: "You don't have permission to do that.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let all = interaction.channel.permissionOverwrites.cache;
|
||||||
|
|
||||||
|
let parent =
|
||||||
|
interaction.guild.channels.cache.find(
|
||||||
|
(c) => c.name === supportbot.UnlockTicketCategory
|
||||||
|
) ||
|
||||||
|
interaction.guild.channels.cache.find(
|
||||||
|
(c) => c.id === supportbot.UnlockTicketCategory
|
||||||
|
);
|
||||||
|
if (parent) {
|
||||||
|
await interaction.channel.setParent(parent.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
all.forEach((perm) => {
|
||||||
|
interaction.channel.permissionOverwrites.create(perm.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
await interaction.channel.permissionOverwrites.create(Admin.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
await interaction.channel.permissionOverwrites.create(
|
||||||
|
interaction.guild.id,
|
||||||
|
{
|
||||||
|
VIEW_CHANNEL: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const CloseButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketclose")
|
||||||
|
.setLabel("Close")
|
||||||
|
.setStyle(supportbot.TicketCloseColour)
|
||||||
|
.setEmoji(supportbot.TicketCloseEmoji);
|
||||||
|
|
||||||
|
const LockButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketlock")
|
||||||
|
.setLabel("Lock")
|
||||||
|
.setStyle(supportbot.TicketLockColour)
|
||||||
|
.setEmoji(supportbot.TicketLockEmoji);
|
||||||
|
|
||||||
|
const TicketClaimButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketclaim")
|
||||||
|
.setLabel("Claim")
|
||||||
|
.setStyle(supportbot.TicketClaimColour)
|
||||||
|
.setEmoji(supportbot.TicketClaimEmoji);
|
||||||
|
|
||||||
|
const row = new Discord.MessageActionRow().addComponents(
|
||||||
|
CloseButton, LockButton, TicketClaimButton
|
||||||
|
);
|
||||||
|
const ArchiveEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Unarchived")
|
||||||
|
.setDescription(`Unarchived ${interaction.channel.name}`)
|
||||||
|
.setColor(supportbot.SuccessColour);
|
||||||
|
|
||||||
|
interaction.reply({ embeds: [ArchiveEmbed] });
|
||||||
|
interaction.message.edit({ components: [row] });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (interaction.customId === "ticketclaim") {
|
||||||
|
if (interaction.channel.name.startsWith(supportbot.TicketPrefix)) {
|
||||||
|
const Staff = await interaction.client.getRole(supportbot.Staff, interaction.guild);
|
||||||
|
interaction.message.fetch();
|
||||||
|
let User = interaction.guild.members.cache.get(interaction.user.id);
|
||||||
|
let Admin =
|
||||||
|
interaction.guild.roles.cache.find(
|
||||||
|
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||||
|
) ||
|
||||||
|
interaction.guild.roles.cache.find(
|
||||||
|
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||||
|
);
|
||||||
|
if (!interaction.member.roles.cache.has(Admin.id)) {
|
||||||
|
return await interaction.reply({
|
||||||
|
content: "You don't have permission to do that.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let all = interaction.channel.permissionOverwrites.cache;
|
||||||
|
|
||||||
|
const ticketUnclaimButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketunclaim")
|
||||||
|
.setLabel("Unclaim")
|
||||||
|
.setStyle(supportbot.TicketUnclaimColour)
|
||||||
|
.setEmoji(supportbot.TicketUnclaimEmoji);
|
||||||
|
|
||||||
|
const CloseButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketclose")
|
||||||
|
.setLabel("Close")
|
||||||
|
.setStyle(supportbot.TicketCloseColour)
|
||||||
|
.setEmoji(supportbot.TicketCloseEmoji);
|
||||||
|
|
||||||
|
const LockButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketlock")
|
||||||
|
.setLabel("Lock")
|
||||||
|
.setStyle(supportbot.TicketLockColour)
|
||||||
|
.setEmoji(supportbot.TicketLockEmoji);
|
||||||
|
|
||||||
|
const row = new Discord.MessageActionRow().addComponents(
|
||||||
|
CloseButton, LockButton, ticketUnclaimButton
|
||||||
|
);
|
||||||
|
const ArchiveEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.TicketClaimTitle)
|
||||||
|
.setDescription(supportbot.TicketClaimMessage + " <@" + interaction.user.id + ">")
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
|
interaction.reply({ embeds: [ArchiveEmbed]});
|
||||||
|
interaction.message.edit({ components: [row] });
|
||||||
|
await interaction.channel.permissionOverwrites.edit(Staff.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
SEND_MESSAGES: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await interaction.channel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
SEND_MESSAGES: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (interaction.customId === "ticketunclaim") {
|
||||||
|
if (interaction.channel.name.startsWith(supportbot.TicketPrefix)) {
|
||||||
|
const Staff = await interaction.client.getRole(supportbot.Staff, interaction.guild);
|
||||||
|
interaction.message.fetch();
|
||||||
|
let User = interaction.guild.members.cache.get(interaction.user.id);
|
||||||
|
let Admin =
|
||||||
|
interaction.guild.roles.cache.find(
|
||||||
|
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||||
|
) ||
|
||||||
|
interaction.guild.roles.cache.find(
|
||||||
|
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||||
|
);
|
||||||
|
if (!interaction.member.roles.cache.has(Admin.id)) {
|
||||||
|
return await interaction.reply({
|
||||||
|
content: "You don't have permission to do that.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let all = interaction.channel.permissionOverwrites.cache;
|
||||||
|
|
||||||
|
const CloseButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketclose")
|
||||||
|
.setLabel("Close")
|
||||||
|
.setStyle(supportbot.TicketCloseColour)
|
||||||
|
.setEmoji(supportbot.TicketCloseEmoji);
|
||||||
|
|
||||||
|
const LockButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketlock")
|
||||||
|
.setLabel("Lock")
|
||||||
|
.setStyle(supportbot.TicketLockColour)
|
||||||
|
.setEmoji(supportbot.TicketLockEmoji);
|
||||||
|
|
||||||
|
const TicketClaimButton = new Discord.MessageButton()
|
||||||
|
.setCustomId("ticketclaim")
|
||||||
|
.setLabel("Claim")
|
||||||
|
.setStyle(supportbot.TicketClaimColour)
|
||||||
|
.setEmoji(supportbot.TicketClaimEmoji);
|
||||||
|
|
||||||
|
const row = new Discord.MessageActionRow().addComponents(
|
||||||
|
CloseButton, LockButton, TicketClaimButton
|
||||||
|
);
|
||||||
|
const ArchiveEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.TicketUnclaimTitle)
|
||||||
|
.setDescription(supportbot.TicketUnclaimMessage + " <@" + interaction.user.id + ">")
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
|
interaction.reply({ embeds: [ArchiveEmbed]});
|
||||||
|
interaction.message.edit({ components: [row] });
|
||||||
|
await interaction.channel.permissionOverwrites.edit(Staff.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
SEND_MESSAGES: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await interaction.channel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
SEND_MESSAGES: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
+110
-24
@@ -14,29 +14,39 @@ const panelconfig = yaml.load(
|
|||||||
|
|
||||||
const Event = require("../Structures/Event.js");
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
module.exports = new Event("ready", (client) => {
|
module.exports = new Event("ready", async (client, interaction) => {
|
||||||
|
const { getRole, getChannel, getCategory } = client;
|
||||||
client.user.setActivity(supportbot.BotActivity, {
|
client.user.setActivity(supportbot.BotActivity, {
|
||||||
type: supportbot.ActivityType,
|
type: supportbot.ActivityType,
|
||||||
url: supportbot.StreamingURL,
|
url: supportbot.StreamingURL,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`\u001b[32m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`);
|
console.log(`\u001b[36m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
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[36m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
console.log(` `);
|
console.log(` `);
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
`${supportbot.Name} v${supportbot.SupportBot_Version}`,
|
`${supportbot.Name} | ${supportbot.SupportBot_Version}`,
|
||||||
`\u001b[36m`,
|
`\u001b[36m`,
|
||||||
`Connected to Discord`
|
`Connected to Discord`
|
||||||
);
|
);
|
||||||
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`Invite to your server:`,
|
||||||
|
`\u001b[36m`,
|
||||||
|
`https://discord.com/api/oauth2/authorize?client_id=` +
|
||||||
|
client.user.id +
|
||||||
|
`&permissions=8&scope=bot%20applications.commands`
|
||||||
|
);
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
`Resources:`,
|
`Resources:`,
|
||||||
@@ -47,7 +57,7 @@ module.exports = new Event("ready", (client) => {
|
|||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
`Documentation:`,
|
`Documentation:`,
|
||||||
`\u001b[36m`,
|
`\u001b[36m`,
|
||||||
`https://supportbot.emeraldsrv.dev`
|
`https://emeraldsrv.dev/wiki/supportbot`
|
||||||
);
|
);
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
@@ -66,9 +76,77 @@ module.exports = new Event("ready", (client) => {
|
|||||||
console.log(` `);
|
console.log(` `);
|
||||||
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const roles = [
|
||||||
|
supportbot.Admin,
|
||||||
|
supportbot.Staff,
|
||||||
|
supportbot.TicketBlackListRole,
|
||||||
|
];
|
||||||
|
|
||||||
|
supportbot.Departments.forEach((department) => roles.push(department.role));
|
||||||
|
|
||||||
|
if (supportbot.AutoRole) roles.push(supportbot.JoinRole);
|
||||||
|
const channels = [
|
||||||
|
supportbot.SuggestionChannel,
|
||||||
|
supportbot.TicketLog,
|
||||||
|
supportbot.TranscriptLog,
|
||||||
|
panelconfig.Channel,
|
||||||
|
supportbot.WelcomeChannel,
|
||||||
|
supportbot.LeaveChannel,
|
||||||
|
supportbot.TranslateLogChannel
|
||||||
|
];
|
||||||
|
//const categories = [supportbot.TicketCategory];
|
||||||
|
|
||||||
|
const missingC = [];
|
||||||
|
const missingR = [];
|
||||||
|
const missingCat = [];
|
||||||
|
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());
|
||||||
|
if (!find) missingC.push(c);
|
||||||
|
}
|
||||||
|
for (let r of roles) {
|
||||||
|
const find = await getRole(r, client.guilds.cache.first());
|
||||||
|
if (!find) missingR.push(r);
|
||||||
|
}
|
||||||
|
// for (let cat of categories) {
|
||||||
|
// const find = await getCategory(cat, client.guilds.cache.first());
|
||||||
|
// if (!find) missingCat.push(cat);
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (missingR.length > 0) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[33m",
|
||||||
|
`[WARN] The following Roles could not be found! Please check your configs!\n${missingR.join(
|
||||||
|
", "
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (missingC.length > 0) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[33m",
|
||||||
|
`[WARN] The following Channels could not be found! Please check your configs!\n${missingC.join(
|
||||||
|
", "
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (missingCat.length > 0) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[33m",
|
||||||
|
`[WARN] The following Categories could not be found! Please check your configs!\n${missingCat.join(
|
||||||
|
", "
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
if (panelconfig.TicketPanel) {
|
if (panelconfig.TicketPanel) {
|
||||||
let chan1 = client.channels.cache.find(
|
let chan1 = await client.getChannel(
|
||||||
(channel) => channel.name === panelconfig.Channel
|
panelconfig.Channel,
|
||||||
|
client.guilds.cache.first()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!chan1) {
|
if (!chan1) {
|
||||||
@@ -83,11 +161,14 @@ module.exports = new Event("ready", (client) => {
|
|||||||
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
);
|
);
|
||||||
|
|
||||||
chan1.messages.fetch(panelid.TicketPanelID).catch(async (r) => {
|
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(supportbot.EmbedFooter);
|
.setFooter({
|
||||||
|
text: supportbot.EmbedFooter,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
});
|
||||||
|
|
||||||
if (panelconfig.TicketPanel_Description) {
|
if (panelconfig.TicketPanel_Description) {
|
||||||
embed.setDescription(panelconfig.PanelMessage);
|
embed.setDescription(panelconfig.PanelMessage);
|
||||||
@@ -100,11 +181,15 @@ module.exports = new Event("ready", (client) => {
|
|||||||
if (panelconfig.TicketPanel_Image) {
|
if (panelconfig.TicketPanel_Image) {
|
||||||
embed.setImage(panelconfig.PanelImage);
|
embed.setImage(panelconfig.PanelImage);
|
||||||
}
|
}
|
||||||
|
let button;
|
||||||
|
|
||||||
let button = new Discord.MessageButton()
|
button = supportbot.Departments.map((x) =>
|
||||||
.setLabel(panelconfig.ButtonLabel)
|
new Discord.MessageButton()
|
||||||
.setCustomId("openticket")
|
.setCustomId("department-" + supportbot.Departments.indexOf(x))
|
||||||
.setStyle(panelconfig.ButtonColour);
|
.setLabel(x.title)
|
||||||
|
.setStyle(x.color)
|
||||||
|
.setEmoji(x.emoji)
|
||||||
|
);
|
||||||
|
|
||||||
let row = new Discord.MessageActionRow().addComponents(button);
|
let row = new Discord.MessageActionRow().addComponents(button);
|
||||||
|
|
||||||
@@ -115,7 +200,8 @@ module.exports = new Event("ready", (client) => {
|
|||||||
})
|
})
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
let data = {
|
let data = {
|
||||||
TicketPanelID: `${r.id}`,
|
id: panelid.id,
|
||||||
|
TicketPanelID: r.id,
|
||||||
};
|
};
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
"./Data/ticket-panel-id.json",
|
"./Data/ticket-panel-id.json",
|
||||||
@@ -124,7 +210,7 @@ module.exports = new Event("ready", (client) => {
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log("Raw" + e);
|
console.log("Raw: " + e);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+21
@@ -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,13 +1,75 @@
|
|||||||

|
<h1 align="center">
|
||||||
|
<br>
|
||||||
|
<a href="https://github.com/Emerald-Services/SupportBot"><img src="https://i.imgur.com/tzi3d7Q.png"></a>
|
||||||
|
<br>
|
||||||
|
SupportBot
|
||||||
|
<br>
|
||||||
|
</h1>
|
||||||
|
|
||||||
## What is SupportBot?
|
<div align="center">
|
||||||
|
|
||||||
|
<a href="https://opensource.org/licenses/MIT">
|
||||||
|
<img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="shield.png">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://github.com/discordjs">
|
||||||
|
<img src="https://img.shields.io/badge/discord.js-v13.6.x-blue.svg?style=for-the-badge&logo=javascript.svg" alt="shield.png">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://github.com/nodejs/node">
|
||||||
|
<img src="https://img.shields.io/badge/node.js-v16.14.x-green.svg?style=for-the-badge&logo=node" alt="shield.png">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://github.com/Emerald-Services/SupportBot/releases">
|
||||||
|
<img src="https://img.shields.io/github/downloads/Emerald-Services/SupportBot/total?style=for-the-badge" alt="shield.png">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://emeraldsrv.dev/">Website</a>
|
||||||
|
•
|
||||||
|
<a href="https://github.com/Emerald-Services/SupportBot/wiki">Wiki</a>
|
||||||
|
<br>
|
||||||
|
<a href="#about">About</a>
|
||||||
|
•
|
||||||
|
<a href="#support">Support</a>
|
||||||
|
•
|
||||||
|
<a href="#license">License</a>
|
||||||
|
•
|
||||||
|
<a href="https://github.com/Emerald-Services/SupportBot/wiki/Third-Party-Developer">Third-Party</a>
|
||||||
|
•
|
||||||
|
<a href="#contributors">Contributors</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
SupportBot is an Open-Source discord bot built with [discord.js](https://github.com/discordjs/discord.js). It's primarily focused to help servers organise and manage their support system in a unique way with full customisation to match your brand.
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
<a href="https://emeraldsrv.dev/discord">
|
||||||
|
<img alt="Discord" src="https://img.shields.io/discord/597779408295821323?logo=discord&logoColor=white&style=for-the-badge">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Released under the [MIT](https://opensource.org/licenses/MIT) license.
|
||||||
|
|
||||||
|
|
||||||
|
## Third-Party
|
||||||
|
|
||||||
|
- [Syphers Addons](https://github.com/SypherRed/SB_Addons_Unofficial)
|
||||||
|
- [BuiltByBit](https://builtbybit.com/supportbot)
|
||||||
|
- [Polymart](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518)
|
||||||
|
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
<a href="https://github.com/Emerald-Services/SupportBot/graphs/contributors">
|
||||||
|
<img src="https://contrib.rocks/image?repo=Emerald-Services/SupportBot">
|
||||||
|
</a>
|
||||||
|
|
||||||
SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customisation to match your own brand.
|
|
||||||
|
|
||||||
## Quick Links
|
|
||||||
|
|
||||||
**|** [Discord](https://emeraldsrv.dev/discord) **|**
|
|
||||||
[Hosting](https://emeraldsrv.dev/hosting) **|**
|
|
||||||
[Documentation](https://docs.emeraldsrv.dev) **|**
|
|
||||||
[Download via Polymart](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518) **|**
|
|
||||||
[Download via MC-Market](https://www.mc-market.org/resources/8940/) **|**
|
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
Use this section to tell people about which versions of your project are
|
||||||
|
currently being supported with security updates.
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 7.7.2 | :white_check_mark: |
|
||||||
|
| 7.7.1 | :white_check_mark: |
|
||||||
|
| < 4.0 | :x: |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
Use this section to tell people how to report a vulnerability.
|
||||||
|
|
||||||
|
Tell them where to go, how often they can expect to get an update on a
|
||||||
|
reported vulnerability, what to expect if the vulnerability is accepted or
|
||||||
|
declined, etc.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Addon Structure
|
||||||
|
|
||||||
|
class Command {
|
||||||
|
constructor(options) {
|
||||||
|
this.name = options.name;
|
||||||
|
this.description = options.description;
|
||||||
|
this.permissions = options.permissions;
|
||||||
|
this.options = options.options || [];
|
||||||
|
this.run = options.run;
|
||||||
|
this.defaultPermission = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class Event {
|
||||||
|
constructor(event, run) {
|
||||||
|
this.event = event;
|
||||||
|
this.run = run;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { Command, Event };
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
// SupportBot | Emerald Services
|
|
||||||
// Addon Structure
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
const supportbot = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
function RunFunction(interaction) {}
|
|
||||||
|
|
||||||
class Addon {
|
|
||||||
constructor(options) {
|
|
||||||
this.name = options.name;
|
|
||||||
this.description = options.description;
|
|
||||||
this.permission = options.permission;
|
|
||||||
this.slashCommandOptions = options.slashCommandOptions || [];
|
|
||||||
this.run = options.run;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Addon;
|
|
||||||
+59
-58
@@ -4,8 +4,6 @@
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const Command = require("./Command.js");
|
|
||||||
const Event = require("./Event.js");
|
|
||||||
const intents = new Discord.Intents(32767);
|
const intents = new Discord.Intents(32767);
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
const yaml = require("js-yaml");
|
||||||
@@ -19,20 +17,48 @@ class Client extends Discord.Client {
|
|||||||
|
|
||||||
this.commands = new Discord.Collection();
|
this.commands = new Discord.Collection();
|
||||||
}
|
}
|
||||||
|
async getChannel(channel, guild) {
|
||||||
|
return guild.channels.cache.find(
|
||||||
|
(c) =>
|
||||||
|
(c.type === "GUILD_TEXT" || c.type === "GUILD_NEWS") &&
|
||||||
|
(c.id === channel || c.name.toLowerCase() === channel.toLowerCase())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
async getRole(role, guild) {
|
||||||
|
return guild.roles.cache.find(
|
||||||
|
(r) => r.id === role || r.name.toLowerCase() === role.toLowerCase()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
async getCategory(category, guild) {
|
||||||
|
return guild.channels.cache.find(
|
||||||
|
(c) =>
|
||||||
|
c.type === "GUILD_CATEGORY" &&
|
||||||
|
(c.id === category || c.name.toLowerCase() === category.toLowerCase())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
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")
|
||||||
.filter((file) => file.endsWith(".js"));
|
.filter((file) => file.endsWith(".js"));
|
||||||
|
|
||||||
const addons = addonFiles.map((file) => require(`../Addons/${file}`));
|
const addons = addonFiles.map((file) => {
|
||||||
|
let addon = require(`../Addons/${file}`);
|
||||||
|
addon.name = file.split(".")[0];
|
||||||
|
return addon;
|
||||||
|
});
|
||||||
|
|
||||||
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
|
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
|
||||||
|
|
||||||
|
// Commands
|
||||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
commands.forEach((cmd) => {
|
commands.forEach((cmd) => {
|
||||||
@@ -40,6 +66,11 @@ class Client extends Discord.Client {
|
|||||||
this.commands.set(cmd.name, cmd);
|
this.commands.set(cmd.name, cmd);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||||
|
// Addons
|
||||||
|
console.log(" ");
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
addons.forEach((addon) => {
|
addons.forEach((addon) => {
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
@@ -49,57 +80,23 @@ class Client extends Discord.Client {
|
|||||||
`\u001b[32;1m`,
|
`\u001b[32;1m`,
|
||||||
"Loaded"
|
"Loaded"
|
||||||
);
|
);
|
||||||
this.commands.set(addon.name, addon);
|
addon.commands?.forEach((command) => {
|
||||||
|
this.commands.set(command.name, command);
|
||||||
|
});
|
||||||
|
addon.events?.forEach((event) => {
|
||||||
|
this.on(event.event, (...args) => event.run(this, ...args));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
// Slash Commands
|
// Slash Commands
|
||||||
|
|
||||||
const slashCommands = commands.map((cmd) => ({
|
this.once("ready", async () => {
|
||||||
name: cmd.name.toLowerCase(),
|
await this.guilds.cache.first()?.commands.set(this.commands);
|
||||||
description: cmd.description,
|
console.log(
|
||||||
permissions: [],
|
`\u001b[32;1m`,
|
||||||
options: cmd.slashCommandOptions,
|
`Slash Commands Registered for ${this.guilds.cache.first().name}`
|
||||||
defaultPermission: true,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const slashCommands1 = addons.map((addon) => ({
|
|
||||||
name: addon.name.toLowerCase(),
|
|
||||||
description: addon.description,
|
|
||||||
permissions: [],
|
|
||||||
options: addon.slashCommandOptions,
|
|
||||||
defaultPermission: true,
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.removeAllListeners();
|
|
||||||
|
|
||||||
this.on("ready", async () => {
|
|
||||||
const allCommands = slashCommands.concat(slashCommands1);
|
|
||||||
await this.application?.commands.set(allCommands);
|
|
||||||
|
|
||||||
console.log(" ");
|
|
||||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Slash Command ▬▬▬▬▬▬▬"),
|
|
||||||
console.log(" ");
|
|
||||||
|
|
||||||
slashCommands.forEach((cmd) =>
|
|
||||||
console.log(
|
|
||||||
`\u001b[31;1m`,
|
|
||||||
`${cmd.name}`,
|
|
||||||
`\u001b[32;1m`,
|
|
||||||
`| Slash Command Registered`
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
slashCommands1.forEach((addon) =>
|
|
||||||
console.log(
|
|
||||||
`\u001b[33m`,
|
|
||||||
`[ADDON]`,
|
|
||||||
`\u001b[31;1m`,
|
|
||||||
`${addon.name}`,
|
|
||||||
`\u001b[32;1m`,
|
|
||||||
`| Slash Command Registered`
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -111,14 +108,18 @@ class Client extends Discord.Client {
|
|||||||
.forEach((file) => {
|
.forEach((file) => {
|
||||||
const event = require(`../Events/${file}`);
|
const event = require(`../Events/${file}`);
|
||||||
console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded");
|
console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded");
|
||||||
|
this.on(event.event, (...args) => event.run(this, ...args));
|
||||||
this.on(event.event, event.run.bind(null, this));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
||||||
console.log(" ");
|
if (process.argv[2] !== "test") {
|
||||||
|
await this.login(token);
|
||||||
this.login(token);
|
} else {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31;1m`,
|
||||||
|
"RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-14
@@ -1,25 +1,14 @@
|
|||||||
// SupportBot | Emerald Services
|
// SupportBot | Emerald Services
|
||||||
// Command Structure
|
// Command Structure
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
const supportbot = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
function RunFunction(interaction) {}
|
|
||||||
|
|
||||||
class Command {
|
class Command {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
this.name = options.name;
|
this.name = options.name;
|
||||||
this.description = options.description;
|
this.description = options.description;
|
||||||
this.permission = options.permission;
|
this.permissions = options.permissions || [];
|
||||||
this.slashCommandOptions = options.slashCommandOptions || [];
|
this.options = options.options || [];
|
||||||
this.run = options.run;
|
this.run = options.run;
|
||||||
|
this.defaultPermission = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Command;
|
module.exports = Command;
|
||||||
+2
-14
@@ -1,21 +1,9 @@
|
|||||||
// SupportBot | Emerald Services
|
// SupportBot | Emerald Services
|
||||||
// Event Structure
|
// Event Structure
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
const supportbot = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
function RunFunction(client, ...eventArgs) {}
|
|
||||||
|
|
||||||
class Event {
|
class Event {
|
||||||
constructor(event, runFunction) {
|
constructor(event, run) {
|
||||||
this.event = event;
|
this.event = event;
|
||||||
this.run = runFunction;
|
this.run = run;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+19
-64
@@ -3,89 +3,44 @@
|
|||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const Command = require("./Command.js");
|
|
||||||
const Client = require("./Client.js");
|
|
||||||
const Event = require("./Event.js");
|
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
const supportbot = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
class TicketNumberID {
|
class TicketNumberID {
|
||||||
static pad(guildId) {
|
static async pad() {
|
||||||
let n = this.get(guildId) + "";
|
let num = await this.get();
|
||||||
let z = "0";
|
let n = num + "";
|
||||||
let width = 4;
|
await this.set(num + 1);
|
||||||
setTimeout(() => {
|
return n.length >= 4 ? n : new Array(4 - n.length + 1).join("0") + n;
|
||||||
this.set(guildId, this.get(guildId) + 1);
|
|
||||||
}, 50);
|
|
||||||
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static get(guildId) {
|
static async get() {
|
||||||
let ticketnumberID = JSON.parse(
|
let ticketnumberID = await JSON.parse(
|
||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
);
|
);
|
||||||
|
if (!ticketnumberID.id) {
|
||||||
if (!ticketnumberID[guildId]) {
|
return this.set(0);
|
||||||
ticketnumberID[guildId] = {
|
|
||||||
id: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
|
||||||
"./Data/TicketData.json",
|
|
||||||
JSON.stringify(ticketnumberID, null, 4),
|
|
||||||
(err) => {
|
|
||||||
if (err) console.log(err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
} else {
|
} else {
|
||||||
return ticketnumberID[guildId].id;
|
return ticketnumberID.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static set(guildId, value) {
|
static async set(value) {
|
||||||
let ticketnumberID = JSON.parse(
|
let ticketnumberID = await JSON.parse(
|
||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
);
|
);
|
||||||
|
|
||||||
ticketnumberID[guildId] = {
|
ticketnumberID.id = value;
|
||||||
id: value,
|
|
||||||
};
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
"./Data/TicketData.json",
|
"./Data/ticket-panel-id.json",
|
||||||
JSON.stringify(ticketnumberID, null, 4),
|
JSON.stringify(ticketnumberID, null, 4),
|
||||||
(err) => {
|
(err) => {
|
||||||
if (err) console.log(err);
|
if (err) console.error(err);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static reset(guildId) {
|
static async reset() {
|
||||||
let ticketnumberID = JSON.parse(
|
return await this.set(0);
|
||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
ticketnumberID[guildId] = {
|
|
||||||
id: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
|
||||||
"./Data/TicketData.json",
|
|
||||||
JSON.stringify(ticketnumberID, null, 4),
|
|
||||||
(err) => {
|
|
||||||
if (err) console.log(err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const yaml = require("js-yaml");
|
const yaml = require("js-yaml");
|
||||||
const supportbot = yaml.load(
|
const supportbot = yaml.load(
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
|||||||
Generated
-526
@@ -1,526 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "supportbot",
|
|
||||||
"version": "7.3.0",
|
|
||||||
"lockfileVersion": 2,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {
|
|
||||||
"": {
|
|
||||||
"name": "supportbot",
|
|
||||||
"version": "7.3.0",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"discord.js": "^13.2.0",
|
|
||||||
"js-yaml": "^4.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@discordjs/builders": {
|
|
||||||
"version": "0.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
|
|
||||||
"integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
|
|
||||||
"dependencies": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"discord-api-types": "^0.22.0",
|
|
||||||
"ow": "^0.27.0",
|
|
||||||
"ts-mixer": "^6.0.0",
|
|
||||||
"tslib": "^2.3.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.0.0",
|
|
||||||
"npm": ">=7.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@discordjs/builders/node_modules/discord-api-types": {
|
|
||||||
"version": "0.22.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
|
||||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@discordjs/collection": {
|
|
||||||
"version": "0.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
|
||||||
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=14.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@discordjs/form-data": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
|
||||||
"dependencies": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "^1.0.8",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@sapphire/async-queue": {
|
|
||||||
"version": "1.1.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.7.tgz",
|
|
||||||
"integrity": "sha512-EBRERa9NqK/EV6DIPBVtjjdHBsu/DSdMuYAydmoIyIPONzp0UAxf2G6JGJ52WkiONtPRx6KNuqB5Q8dm14fwyw==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=v14.0.0",
|
|
||||||
"npm": ">=7.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@sindresorhus/is": {
|
|
||||||
"version": "4.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
|
|
||||||
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sindresorhus/is?sponsor=1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/node": {
|
|
||||||
"version": "16.11.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.4.tgz",
|
|
||||||
"integrity": "sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ=="
|
|
||||||
},
|
|
||||||
"node_modules/@types/ws": {
|
|
||||||
"version": "8.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
|
|
||||||
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/argparse": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
|
||||||
},
|
|
||||||
"node_modules/asynckit": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
||||||
},
|
|
||||||
"node_modules/callsites": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/combined-stream": {
|
|
||||||
"version": "1.0.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
|
||||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
|
||||||
"dependencies": {
|
|
||||||
"delayed-stream": "~1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/delayed-stream": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/discord-api-types": {
|
|
||||||
"version": "0.23.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
|
||||||
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/discord.js": {
|
|
||||||
"version": "13.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.2.0.tgz",
|
|
||||||
"integrity": "sha512-nyxUvL8wuQG38zx13wUMkpcA8koFszyiXdkSLwwM9opKW2LC2H5gD0cTZxImeJ6GtEnKPWT8xBiE8lLBmbNIhw==",
|
|
||||||
"dependencies": {
|
|
||||||
"@discordjs/builders": "^0.6.0",
|
|
||||||
"@discordjs/collection": "^0.2.1",
|
|
||||||
"@discordjs/form-data": "^3.0.1",
|
|
||||||
"@sapphire/async-queue": "^1.1.5",
|
|
||||||
"@types/ws": "^8.2.0",
|
|
||||||
"discord-api-types": "^0.23.1",
|
|
||||||
"node-fetch": "^2.6.1",
|
|
||||||
"ws": "^8.2.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16.6.0",
|
|
||||||
"npm": ">=7.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/dot-prop": {
|
|
||||||
"version": "6.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
|
||||||
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
|
|
||||||
"dependencies": {
|
|
||||||
"is-obj": "^2.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/is-obj": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/js-yaml": {
|
|
||||||
"version": "4.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
|
||||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
|
||||||
"dependencies": {
|
|
||||||
"argparse": "^2.0.1"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"js-yaml": "bin/js-yaml.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/lodash.isequal": {
|
|
||||||
"version": "4.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
|
||||||
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
|
|
||||||
},
|
|
||||||
"node_modules/mime-db": {
|
|
||||||
"version": "1.50.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
|
|
||||||
"integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/mime-types": {
|
|
||||||
"version": "2.1.33",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
|
|
||||||
"integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
|
|
||||||
"dependencies": {
|
|
||||||
"mime-db": "1.50.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/node-fetch": {
|
|
||||||
"version": "2.6.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
|
|
||||||
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"whatwg-url": "^5.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "4.x || >=6.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ow": {
|
|
||||||
"version": "0.27.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
|
|
||||||
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"callsites": "^3.1.0",
|
|
||||||
"dot-prop": "^6.0.1",
|
|
||||||
"lodash.isequal": "^4.5.0",
|
|
||||||
"type-fest": "^1.2.1",
|
|
||||||
"vali-date": "^1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/tr46": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
|
||||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
|
||||||
},
|
|
||||||
"node_modules/ts-mixer": {
|
|
||||||
"version": "6.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
|
|
||||||
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
|
|
||||||
},
|
|
||||||
"node_modules/tslib": {
|
|
||||||
"version": "2.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
|
||||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
|
||||||
},
|
|
||||||
"node_modules/type-fest": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
|
||||||
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/vali-date": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/webidl-conversions": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
|
||||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
|
||||||
},
|
|
||||||
"node_modules/whatwg-url": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
|
||||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
|
||||||
"dependencies": {
|
|
||||||
"tr46": "~0.0.3",
|
|
||||||
"webidl-conversions": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ws": {
|
|
||||||
"version": "8.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
|
|
||||||
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10.0.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"bufferutil": "^4.0.1",
|
|
||||||
"utf-8-validate": "^5.0.2"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"bufferutil": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"utf-8-validate": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@discordjs/builders": {
|
|
||||||
"version": "0.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
|
|
||||||
"integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
|
|
||||||
"requires": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"discord-api-types": "^0.22.0",
|
|
||||||
"ow": "^0.27.0",
|
|
||||||
"ts-mixer": "^6.0.0",
|
|
||||||
"tslib": "^2.3.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"discord-api-types": {
|
|
||||||
"version": "0.22.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
|
||||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@discordjs/collection": {
|
|
||||||
"version": "0.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
|
||||||
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog=="
|
|
||||||
},
|
|
||||||
"@discordjs/form-data": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
|
||||||
"requires": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "^1.0.8",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@sapphire/async-queue": {
|
|
||||||
"version": "1.1.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.7.tgz",
|
|
||||||
"integrity": "sha512-EBRERa9NqK/EV6DIPBVtjjdHBsu/DSdMuYAydmoIyIPONzp0UAxf2G6JGJ52WkiONtPRx6KNuqB5Q8dm14fwyw=="
|
|
||||||
},
|
|
||||||
"@sindresorhus/is": {
|
|
||||||
"version": "4.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
|
|
||||||
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw=="
|
|
||||||
},
|
|
||||||
"@types/node": {
|
|
||||||
"version": "16.11.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.4.tgz",
|
|
||||||
"integrity": "sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ=="
|
|
||||||
},
|
|
||||||
"@types/ws": {
|
|
||||||
"version": "8.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
|
|
||||||
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
|
|
||||||
"requires": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"argparse": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
|
||||||
},
|
|
||||||
"asynckit": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
||||||
},
|
|
||||||
"callsites": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
|
|
||||||
},
|
|
||||||
"combined-stream": {
|
|
||||||
"version": "1.0.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
|
||||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
|
||||||
"requires": {
|
|
||||||
"delayed-stream": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"delayed-stream": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
|
||||||
},
|
|
||||||
"discord-api-types": {
|
|
||||||
"version": "0.23.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
|
||||||
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ=="
|
|
||||||
},
|
|
||||||
"discord.js": {
|
|
||||||
"version": "13.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.2.0.tgz",
|
|
||||||
"integrity": "sha512-nyxUvL8wuQG38zx13wUMkpcA8koFszyiXdkSLwwM9opKW2LC2H5gD0cTZxImeJ6GtEnKPWT8xBiE8lLBmbNIhw==",
|
|
||||||
"requires": {
|
|
||||||
"@discordjs/builders": "^0.6.0",
|
|
||||||
"@discordjs/collection": "^0.2.1",
|
|
||||||
"@discordjs/form-data": "^3.0.1",
|
|
||||||
"@sapphire/async-queue": "^1.1.5",
|
|
||||||
"@types/ws": "^8.2.0",
|
|
||||||
"discord-api-types": "^0.23.1",
|
|
||||||
"node-fetch": "^2.6.1",
|
|
||||||
"ws": "^8.2.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dot-prop": {
|
|
||||||
"version": "6.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
|
||||||
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
|
|
||||||
"requires": {
|
|
||||||
"is-obj": "^2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"is-obj": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
|
|
||||||
},
|
|
||||||
"js-yaml": {
|
|
||||||
"version": "4.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
|
||||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
|
||||||
"requires": {
|
|
||||||
"argparse": "^2.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lodash.isequal": {
|
|
||||||
"version": "4.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
|
||||||
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
|
|
||||||
},
|
|
||||||
"mime-db": {
|
|
||||||
"version": "1.50.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
|
|
||||||
"integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A=="
|
|
||||||
},
|
|
||||||
"mime-types": {
|
|
||||||
"version": "2.1.33",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
|
|
||||||
"integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
|
|
||||||
"requires": {
|
|
||||||
"mime-db": "1.50.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node-fetch": {
|
|
||||||
"version": "2.6.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
|
|
||||||
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
|
|
||||||
"requires": {
|
|
||||||
"whatwg-url": "^5.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ow": {
|
|
||||||
"version": "0.27.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
|
|
||||||
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
|
|
||||||
"requires": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"callsites": "^3.1.0",
|
|
||||||
"dot-prop": "^6.0.1",
|
|
||||||
"lodash.isequal": "^4.5.0",
|
|
||||||
"type-fest": "^1.2.1",
|
|
||||||
"vali-date": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tr46": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
|
||||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
|
||||||
},
|
|
||||||
"ts-mixer": {
|
|
||||||
"version": "6.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
|
|
||||||
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
|
|
||||||
},
|
|
||||||
"tslib": {
|
|
||||||
"version": "2.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
|
||||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
|
||||||
},
|
|
||||||
"type-fest": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
|
||||||
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA=="
|
|
||||||
},
|
|
||||||
"vali-date": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
|
|
||||||
},
|
|
||||||
"webidl-conversions": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
|
||||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
|
||||||
},
|
|
||||||
"whatwg-url": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
|
||||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
|
||||||
"requires": {
|
|
||||||
"tr46": "~0.0.3",
|
|
||||||
"webidl-conversions": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ws": {
|
|
||||||
"version": "8.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
|
|
||||||
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
|
|
||||||
"requires": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+7
-4
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "supportbot",
|
"name": "supportbot",
|
||||||
"version": "7.3.0",
|
"version": "7.7.3",
|
||||||
"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": {
|
||||||
"start": "npm i && node index.js"
|
"start": "npm i && node index.js",
|
||||||
|
"test": "node index.js test"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -17,7 +18,9 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/Emerald-Services/SupportBot#readme",
|
"homepage": "https://github.com/Emerald-Services/SupportBot#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^13.2.0",
|
"@vitalets/google-translate-api": "^8.0.0",
|
||||||
"js-yaml": "^4.1.0"
|
"discord.js": "^13.6.0",
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
|
"moment": "^2.29.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user