This commit is contained in:
Noah committed 2022-01-30 00:07:04 -06:00
1 parent dcba3312dd
commit ebe29b403e
9 files changed
+30 -35

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# This workflow will do a clean installation of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"],
async run(interaction) {
const { getRole} = interaction.client;
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
if (!SupportStaff || !Admin)
+3 -3
View File
@@ -25,7 +25,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"],
async run(interaction) {
const { getRole, getChannel} = interaction.client;
const { getRole, getChannel } = interaction.client;
if (supportbot.StaffOnly) {
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
@@ -163,8 +163,8 @@ module.exports = new Command({
if (ticket.subUsers) {
ticket.subUsers.forEach(async (subUser) => {
await interaction.client.users.cache
.get(subUser)
.send({embeds: [transcriptEmbed], files: [file]});
.get(subUser)
.send({ embeds: [transcriptEmbed], files: [file] });
});
}
await interaction.channel.delete().catch(async (error) => {
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"],
async run(interaction) {
const { getRole} = interaction.client;
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
+1 -1
View File
@@ -19,7 +19,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"],
async run(interaction) {
const { getRole} = interaction.client;
const { getRole } = interaction.client;
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
if (!SupportStaff || !Admin)
+2 -2
View File
@@ -26,7 +26,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"],
async run(interaction) {
const { getRole} = interaction.client;
const { getRole } = interaction.client;
let Staff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild);
if (!Staff || !Admin)
@@ -71,7 +71,7 @@ module.exports = new Command({
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
await interaction.channel.permissionOverwrites.edit(uMember.id, {
VIEW_CHANNEL: false,
VIEW_CHANNEL: false,
});
const Complete = new Discord.MessageEmbed()
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"],
async run(interaction) {
const { getChannel} = interaction.client;
const { getChannel } = interaction.client;
const suggestChannel = await getChannel(
supportbot.SuggestionChannel,
interaction.guild
+20 -20
View File
@@ -39,12 +39,12 @@ class Client extends Discord.Client {
async start(token) {
const commandFiles = fs
.readdirSync("./Commands")
.filter((file) => file.endsWith(".js"));
.readdirSync("./Commands")
.filter((file) => file.endsWith(".js"));
const addonFiles = fs
.readdirSync("./Addons")
.filter((file) => file.endsWith(".js"));
.readdirSync("./Addons")
.filter((file) => file.endsWith(".js"));
const addons = addonFiles.map((file) => {
let addon = require(`../Addons/${file}`);
@@ -69,12 +69,12 @@ class Client extends Discord.Client {
addons.forEach((addon) => {
console.log(
`\u001b[33m`,
`[ADDON]`,
`\u001b[31;1m`,
`${addon.name}`,
`\u001b[32;1m`,
"Loaded"
`\u001b[33m`,
`[ADDON]`,
`\u001b[31;1m`,
`${addon.name}`,
`\u001b[32;1m`,
"Loaded"
);
addon.commands.forEach((command) => {
this.commands.set(command.name, command);
@@ -91,8 +91,8 @@ class Client extends Discord.Client {
this.once("ready", async () => {
await this.application?.commands.set(this.commands, supportbot.Guild);
console.log(
`\u001b[32;1m`,
`Slash Commands Registered for ${this.guilds.cache.first().name}`
`\u001b[32;1m`,
`Slash Commands Registered for ${this.guilds.cache.first().name}`
);
});
@@ -100,20 +100,20 @@ class Client extends Discord.Client {
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
fs.readdirSync("./Events")
.filter((file) => file.endsWith(".js"))
.forEach((file) => {
const event = require(`../Events/${file}`);
console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded");
this.on(event.event, (...args) => event.run(this, ...args));
});
.filter((file) => file.endsWith(".js"))
.forEach((file) => {
const event = require(`../Events/${file}`);
console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded");
this.on(event.event, (...args) => event.run(this, ...args));
});
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
if (process.argv[2] !== "test") {
await this.login(token);
} else {
console.log(
`\u001b[31;1m`,
"RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start"
`\u001b[31;1m`,
"RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start"
);
}
}
-5
View File
@@ -1,10 +1,6 @@
// SupportBot | Emerald Services
// Command Structure
const fs = require("fs");
const yaml = require("js-yaml");
class Command {
constructor(options) {
this.name = options.name;
@@ -15,5 +11,4 @@ class Command {
this.defaultPermission = true;
}
}
module.exports = Command;