Skip to content

Commit

Permalink
last minute stuff
Browse files Browse the repository at this point in the history
Signed-off-by: RedGuy12 <paul@reid-family.org>
  • Loading branch information
cobaltt7 committed Sep 26, 2022
1 parent 8f35f98 commit da93075
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
8 changes: 1 addition & 7 deletions common/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ export async function generateBoardMessage(info, extraButtons = {}) {

content: `**${BOARD_EMOJI} ${count}** | ${
message.channel.isThread() && message.channel.parent
? `${
[CONSTANTS.channels.modmail?.id, CONSTANTS.channels.admin?.id].includes(
message.channel.parent.id,
)
? "#deleted-channel"
: message.channel.toString()
} (${message.channel.parent.toString()})`
? `${message.channel.toString()} (${message.channel.parent.toString()})`
: message.channel.toString()
} | ${message.author.toString()}`,
embeds: [boardEmbed, ...embeds],
Expand Down
6 changes: 5 additions & 1 deletion events/guild/member/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ export default async function event(oldMember, newMember) {
newMember.communicationDisabledUntil > new Date()
)
logs.push(" timed out until " + time(newMember.communicationDisabledUntil));
else if (oldMember.communicationDisabledUntil) logs.push("’s timeout was removed");
else if (
oldMember.communicationDisabledUntil &&
oldMember.communicationDisabledUntil > new Date()
)
logs.push("’s timeout was removed");
}
if (oldMember.nickname !== newMember.nickname) {
logs.push(
Expand Down
14 changes: 6 additions & 8 deletions events/guild/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,18 @@ export default async function event(oldGuild, newGuild) {
);
}
if (
oldGuild.features.includes("HAS_DIRECTORY_ENTRY") !==
newGuild.features.includes("HAS_DIRECTORY_ENTRY")
oldGuild.features.includes("INVITES_DISABLED") !==
newGuild.features.includes("INVITES_DISABLED")
) {
logs.push(
`➕ Invites ${newGuild.features.includes("HAS_DIRECTORY_ENTRY") ? "" : "un"}paused`,
);
logs.push(`➕ Invites ${newGuild.features.includes("INVITES_DISABLED") ? "" : "un"}paused`);
}
if (
oldGuild.features.includes("INVITES_DISABLED") !==
newGuild.features.includes("INVITES_DISABLED")
oldGuild.features.includes("HAS_DIRECTORY_ENTRY") !==
newGuild.features.includes("HAS_DIRECTORY_ENTRY")
) {
logs.push(
`Server ${
newGuild.features.includes("INVITES_DISABLED") ? "add" : "remov"
newGuild.features.includes("HAS_DIRECTORY_ENTRY") ? "add" : "remov"
}ed from a directory channel`,
);
}
Expand Down
5 changes: 3 additions & 2 deletions events/voiceStateUpdate.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import CONSTANTS from "../common/CONSTANTS.js";
import log from "../common/moderation/logging.js";

/** @type {import("../common/types/event").default<"voiceStateUpdate">} */
export default async function event(oldState, newState) {
if (!newState.member || newState.guild.id !== process.env.GUILD_ID) return;

const logs = [];
if (oldState.channel?.id !== newState.channel?.id || !newState.channel) {
if (oldState.channel?.id !== newState.channel?.id && newState.member.id !== CONSTANTS.robotop) {
if (newState.channel) {
logs.push(
`joined voice channel ${newState.channel.toString()}, ${
Expand All @@ -16,7 +17,7 @@ export default async function event(oldState, newState) {
if (oldState.channel) {
logs.push(`left voice channel ${oldState.channel.toString()}`);
}
} else {
} else if (newState.channel) {
if (oldState.serverMute !== newState.serverMute) {
logs.push(`was${newState.serverMute ? "" : " un"} server muted`);
} else if (oldState.mute !== newState.mute) {
Expand Down

0 comments on commit da93075

Please sign in to comment.