edits to role command and log member verify
diff --git a/src/api/index.ts b/src/api/index.ts
index f5424b3..00c866d 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -3,6 +3,7 @@
import bodyParser from 'body-parser';
import EmojiEmbed from "../utils/generateEmojiEmbed.js";
import structuredClone from '@ungap/structured-clone';
+import client from '../utils/client.js';
const jsonParser = bodyParser.json();
@@ -17,6 +18,7 @@
app.post('/verify/:code', jsonParser, async function (req, res) {
const code = req.params.code;
const secret = req.body.secret;
+ const { log, NucleusColors, entry, renderUser } = client.logger
if (secret === client.config.verifySecret) {
let guild = await client.guilds.fetch(client.verify[code].gID);
if (!guild) { return res.status(404) }
@@ -34,6 +36,26 @@
.setEmoji("MEMBER.JOIN")
], components: []});
}
+ try {
+ let data = {
+ meta:{
+ type: 'memberVerify',
+ displayName: 'Member Verified',
+ calculateType: 'guildMemberVerify',
+ color: NucleusColors.green,
+ emoji: "CONTROL.BLOCKTICK",
+ timestamp: new Date().getTime()
+ },
+ list: {
+ id: entry(member.id, `\`${member.id}\``),
+ member: entry(member.id, renderUser(member))
+ },
+ hidden: {
+ guild: guild.id
+ }
+ }
+ log(data);
+ } catch {}
res.sendStatus(200);
} else {
res.sendStatus(403);
diff --git a/src/commands/role/all.ts b/src/commands/role/all.ts
index d24110b..b2b8c52 100644
--- a/src/commands/role/all.ts
+++ b/src/commands/role/all.ts
@@ -38,17 +38,14 @@
},
joined: {
render: "joined",
- before: (date) => ( new Filter((data) => `Joined server before <t:${Math.round(date.getTime() / 1000)}:F>`, {date: date, type: Date, render: "before"}, (member) => {
+ before: (date) => ( new Filter((data) => `Joined server before <t:${Math.round(date.getTime() / 1000)}:D>`, {date: date, type: Date, render: "before"}, (member) => {
return member.joinedTimestamp < date.getTime()
- })),
- after: (date) => ( new Filter((data) => `Joined server after <t:${Math.round(date.getTime() / 1000)}:F>`, {date: date, type: Date, render: "after"}, (member) => {
- return member.joinedTimestamp > date.getTime()
- }).flip())
+ }))
},
nickname: {
render: "Nickname",
set: () => ( new Filter((data) => `Member has a nickname set"`, {render: "set"}, (member) => { return member.nickname !== null})),
- include: (name) => ( new Filter((data) => `Nickname includes "${name}"`, {nickname: name, type: String, render: "includes"}, (member) => {
+ includes: (name) => ( new Filter((data) => `Nickname includes "${name}"`, {nickname: name, type: String, render: "includes"}, (member) => {
return member.displayName.includes(name)})),
startsWith: (name) => ( new Filter((data) => `Nickname starts with "${name}"`, {nickname: name, type: String, render: "starts with"}, (member) => {
return member.displayName.startsWith(name)})),
@@ -62,10 +59,7 @@
render: "created",
before: (date) => ( new Filter((data) => `Account created before <t:${Math.round(date.getTime() / 1000)}:D>`, {date: date, type: Date, render: "before"}, (member) => {
return member.user.createdTimestamp < date.getTime()
- })),
- after: (date) => ( new Filter((data) => `Account created after <t:${Math.round(date.getTime() / 1000)}:D>`, {date: date, type: Date, render: "after"}, (member) => {
- return member.user.createdTimestamp < date.getTime()
- }).flip())
+ }))
},
is: {
render: "is",
@@ -73,7 +67,7 @@
},
username: {
render: "Username",
- include: (name) => ( new Filter((data) => `Nickname includes "${name}"`, {nickname: name, type: String, render: "includes"}, (member) => {
+ includes: (name) => ( new Filter((data) => `Nickname includes "${name}"`, {nickname: name, type: String, render: "includes"}, (member) => {
return member.user.name.includes(name)})),
startsWith: (name) => ( new Filter((data) => `Nickname starts with "${name}"`, {nickname: name, type: String, render: "starts with"}, (member) => {
return member.user.name.startsWith(name)})),
diff --git a/src/commands/role/user.ts b/src/commands/role/user.ts
index bb79098..c2ade39 100644
--- a/src/commands/role/user.ts
+++ b/src/commands/role/user.ts
@@ -76,8 +76,6 @@
if (member.id == interaction.guild.ownerId) return true
// Check if the user has manage_roles permission
if (! member.permissions.has("MANAGE_ROLES")) throw "You do not have the Manage roles permission";
- // Check if the role is above or equal to the user's highest role
- if (apply.roles.highest.comparePositionTo(member.roles.highest) >= 0) throw "You cannot give a role higher than your highest role";
// Allow role
return true;
}
diff --git a/src/config/emojis.json b/src/config/emojis.json
index b91cdbf..f6eabe0 100644
--- a/src/config/emojis.json
+++ b/src/config/emojis.json
@@ -42,6 +42,7 @@
"TICK": "947441964234702849",
"CROSS": "947441948543815720",
"BLOCKCROSS": "952261738349330493",
+ "BLOCKTICK": "991805475777695855",
"LEFT": "947441951148486728",
"RIGHT": "947441957473488916",
"UP": "963409197293273108",
diff --git a/src/utils/calculate.ts b/src/utils/calculate.ts
index a991918..a58fae1 100644
--- a/src/utils/calculate.ts
+++ b/src/utils/calculate.ts
@@ -17,7 +17,7 @@
"messageAnnounce", // TODO
"threadUpdate",
"webhookUpdate", // TODO
- "guildMemberVerify", // TODO
+ "guildMemberVerify",
"autoModeratorDeleted", // TODO
"nucleusSettingsUpdated", // TODO
""