Skip to content

Commit

Permalink
v2.8.2
Browse files Browse the repository at this point in the history
- feat: Add `/custom-role` command
- feat: Add `/thread` command
- impr: Make reminder times case insensitive
- impr: Update autoreactions
- fix: Log deleted messages again
- fix: Correct active role 1-week threshold
- fix: Account for unset display names in modlogs
- fix: Reword `/reminders add`'s `time` option's description
- fix: Update bad words list
- fix: Reword `/guess-addon`'s description

Signed-off-by: RedGuy12 <[email protected]>
  • Loading branch information
cobaltt7 committed Jun 19, 2023
1 parent 845c46f commit 0b00421
Show file tree
Hide file tree
Showing 13 changed files with 629 additions and 185 deletions.
1 change: 1 addition & 0 deletions common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ async function getConfig() {
return {
roles: {
admin: roles.find((role) => role.name.toLowerCase().includes("admin")),
exec: roles.find((role) => role.name.toLowerCase().includes("exec")),
mod: roles.find((role) => role.name.toLowerCase().includes("mod")),
weekly_winner: roles.find((role) => role.name.toLowerCase().includes("weekly")),
epic: roles.find((role) => role.name.toLowerCase().includes("epic")),
Expand Down
2 changes: 1 addition & 1 deletion modules/games/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import constants from "../../common/constants.js";
import { disableComponents } from "../../util/discord.js";

defineCommand(
{ name: "guess-addon", description: "Think of an addon and I will guess it!" },
{ name: "guess-addon", description: "Think of an addon for me to guess it" },
guessAddon,
);

Expand Down
2 changes: 1 addition & 1 deletion modules/games/memoryMatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,5 @@ async function setupGame(difficulty: 2 | 4) {
export async function messageDelete(message: Message | PartialMessage) {
const index = deletedPings.indexOf(message.id);
if (index > -1) deletedPings.splice(index, 1);
return index > -1;
return index === -1;
}
15 changes: 1 addition & 14 deletions modules/logging/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from "discord.js";
import config from "../../common/config.js";
import { defineEvent } from "strife.js";
import log, { extraAuditLogsInfo, LoggingEmojis, LOG_GROUPS } from "./misc.js";
import log, { extraAuditLogsInfo, LoggingEmojis } from "./misc.js";
import { unifiedDiff } from "difflib";
import {
channelCreate,
Expand Down Expand Up @@ -57,7 +57,6 @@ import {
guildScheduledEventUpdate,
voiceStateUpdate,
} from "./voice.js";
import { DATABASE_THREAD } from "../../common/database.js";

const events: {
[event in AuditLogEvent]?: (entry: GuildAuditLogsEntry<event>) => void | Promise<void>;
Expand Down Expand Up @@ -825,15 +824,3 @@ defineEvent("roleDelete", async (role) => {
defineEvent("threadUpdate", threadUpdate);
defineEvent("userUpdate", userUpdate);
defineEvent("voiceStateUpdate", voiceStateUpdate);
defineEvent("threadUpdate", async (_, newThread) => {
if (
newThread.archived &&
(((newThread.name === DATABASE_THREAD || LOG_GROUPS.includes(newThread.name)) &&
newThread.parent?.id === config.channels.modlogs?.id) ||
[
"1029234332977602660", // #YouTube planning
"988780044627345468", // #Server Suggestions
].includes(newThread.id))
)
await newThread.setArchived(false, "Modlog threads must stay open");
});
6 changes: 4 additions & 2 deletions modules/logging/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ export async function userUpdate(oldUser: User | PartialUser, newUser: User) {
await log(
`${LoggingEmojis.UserUpdate} ${newUser.toString()}${
newUser.globalName
? ` changed their display name from ${oldUser.globalName} to ${newUser.globalName}`
: "’s nickname was removed"
? oldUser.globalName
? ` changed their display name from ${oldUser.globalName} to ${newUser.globalName}`
: ` set their display name to ${newUser.globalName}`
: "’s display name was removed"
}`,
"members",
);
Expand Down
15 changes: 0 additions & 15 deletions modules/notifs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@ defineEvent("messageCreate", async (message) => {
}
});

defineEvent("threadCreate", async (thread, newlyCreated) => {
if (thread.guild.id !== config.guild.id || !newlyCreated) return;

const toPing = [config.channels.mod?.id, config.channels.modlogs?.id].includes(
thread.parent?.id,
)
? config.roles.mod?.toString()
: thread.parent?.id === config.channels.exec?.id
? "<@&1046043735680630784>" // @Executive
: thread.parent?.id === config.channels.admin?.id
? config.roles.admin?.toString()
: undefined;
if (toPing) await thread.send({ content: toPing, allowedMentions: { parse: ["roles"] } });
});

defineEvent("guildMemberAdd", async (member) => {
if (member.guild.id !== config.guild.id) return;

Expand Down
Loading

0 comments on commit 0b00421

Please sign in to comment.