merge
This commit is contained in:
commit
0baa253d2c
4 changed files with 651 additions and 660 deletions
|
@ -52,10 +52,13 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
run: async (client, interaction, args) => {
|
||||
repEmb = null;
|
||||
recoilAvailable = false;
|
||||
hasError = false;
|
||||
console.log(args, args.join("+"));
|
||||
const repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
||||
if (args.length == 1)
|
||||
repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
||||
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
|
||||
|
||||
if (hasError) {
|
||||
interaction.followUp({ embeds: [new MessageEmbed(repEmb)] });
|
||||
}
|
||||
|
|
3
index.js
3
index.js
|
@ -1,7 +1,8 @@
|
|||
const { HTTPError, DiscordAPIError } = require("discord.js");
|
||||
const NYX = require("./client/NYX");
|
||||
const client = new NYX();
|
||||
module.exports = client;
|
||||
process.on("unhandledRejection", err => {
|
||||
console.log(err);
|
||||
console.error(err);
|
||||
});
|
||||
client.start();
|
||||
|
|
44
util/dist/handler.js
vendored
44
util/dist/handler.js
vendored
|
@ -1,3 +1,4 @@
|
|||
const { DiscordAPIError, HTTPError } = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const cmds = [];
|
||||
const ownercmds = [];
|
||||
|
@ -30,27 +31,28 @@ module.exports = async client => {
|
|||
client.on("ready", async () => {
|
||||
const gg = client.guilds.cache.get("840225563193114624");
|
||||
await gg.commands.set(ownercmds);
|
||||
await client.application.commands.set(cmds).then(async cmd => {
|
||||
client.guilds.cache.forEach(g => {
|
||||
const getroles = name => {
|
||||
const perms = cmds.find(n => n.name == name).UserPerms;
|
||||
if (!perms) return null;
|
||||
return g.roles.cache.filter(
|
||||
z => z.permissions.has(perms) && !z.managed
|
||||
);
|
||||
};
|
||||
const fullPermissions = cmd.reduce((accumulator, v) => {
|
||||
const roles = getroles(v.name);
|
||||
if (!roles) return accumulator;
|
||||
const permissions = roles.reduce((a, w) => {
|
||||
return [...a, { id: w.id, type: "ROLE", permission: true }];
|
||||
await client.application.commands
|
||||
.set(cmds)
|
||||
.then(async cmd => {
|
||||
client.guilds.cache.forEach(g => {
|
||||
const getroles = name => {
|
||||
const perms = cmds.find(n => n.name == name).UserPerms;
|
||||
if (!perms) return null;
|
||||
return g.roles.cache.filter(
|
||||
z => z.permissions.has(perms) && !z.managed
|
||||
);
|
||||
};
|
||||
const fullPermissions = cmd.reduce((accumulator, v) => {
|
||||
const roles = getroles(v.name);
|
||||
if (!roles) return accumulator;
|
||||
const permissions = roles.reduce((a, w) => {
|
||||
return [...a, { id: w.id, type: "ROLE", permission: true }];
|
||||
}, []);
|
||||
return [...accumulator, { id: v.id, permissions }];
|
||||
}, []);
|
||||
return [...accumulator, { id: v.id, permissions }];
|
||||
}, []);
|
||||
try {
|
||||
g.commands.permissions.set({ fullPermissions });
|
||||
} catch {}
|
||||
});
|
||||
});
|
||||
g.commands.permissions.set({ fullPermissions }).catch(null);
|
||||
});
|
||||
})
|
||||
.catch(null);
|
||||
});
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue