From c1745b9a6a6c37c205e8eda986bad0bed1176af0 Mon Sep 17 00:00:00 2001 From: cobalt <61329810+RedGuy12@users.noreply.github.com> Date: Wed, 24 Jul 2024 10:25:15 -0500 Subject: [PATCH] Update v3.0.4 Signed-off-by: cobalt <61329810+RedGuy12@users.noreply.github.com> --- .github/workflows/deploy.yml | 12 ++++++------ common/features.ts | 2 ++ modules/bot/index.ts | 3 ++- modules/logging/messages.ts | 26 ++++++++++++++------------ modules/threads/index.ts | 3 ++- package-lock.json | 4 ++-- package.json | 2 +- 7 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c11d94be7..7eab11505 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,20 +21,20 @@ jobs: node-version: 20.6.0 cache: npm - - name: Download autos data + - name: Download bad words run: curl "https://gist.githubusercontent.com/${{ secrets.PRIVATE_GIST - }}/raw/autos-data.ts" --output modules/auto/autos-data.ts + }}/raw/automod_bad-words.ts" --output modules/automod/bad-words.ts - - name: Download bad words + - name: Download autos data run: curl "https://gist.githubusercontent.com/${{ secrets.PRIVATE_GIST - }}/raw/bad-words.ts" --output modules/automod/bad-words.ts + }}/raw/autos_autos-data.ts" --output modules/autos/autos-data.ts - name: Download dad run: - curl "https://gist.githubusercontent.com/${{ secrets.PRIVATE_GIST }}/raw/dad.ts" - --output modules/auto/dad.ts + curl "https://gist.githubusercontent.com/${{ secrets.PRIVATE_GIST + }}/raw/autos_dad.ts" --output modules/autos/dad.ts - name: Download strings run: diff --git a/common/features.ts b/common/features.ts index 1faf3f000..34d9861de 100644 --- a/common/features.ts +++ b/common/features.ts @@ -6,10 +6,12 @@ export default { (await import("@napi-rs/canvas").then(...callbacks)) && (await import("chart.js").then(...callbacks)), autosTypeInChat: auto, + botRunTestingServer: auto, executeCaesar: auto, executeCoinFlip: auto, formsPingForAppeals: auto, joinsAutoKick: auto, joinsDmRevision: auto, + threadsTestingServer: auto, ticketsPingForReports: auto, }; diff --git a/modules/bot/index.ts b/modules/bot/index.ts index 126b9f7a2..8e6976480 100644 --- a/modules/bot/index.ts +++ b/modules/bot/index.ts @@ -8,6 +8,7 @@ import getCode, { run } from "./run.js"; import sayCommand, { say } from "./say.js"; import status from "./status.js"; import config from "../../common/config.js"; +import features from "../../common/features.js"; defineMenuCommand( { name: "Edit Message", restricted: true, type: ApplicationCommandType.Message, access: false }, @@ -21,7 +22,7 @@ defineChatCommand( description: "Run code on the bot", restricted: true, access: - process.env.NODE_ENV === "production" ? + features.botRunTestingServer && process.env.NODE_ENV === "production" ? ["@defaults", config.guilds.testing.id] : undefined, }, diff --git a/modules/logging/messages.ts b/modules/logging/messages.ts index 94b679fec..145314dca 100644 --- a/modules/logging/messages.ts +++ b/modules/logging/messages.ts @@ -142,18 +142,20 @@ export async function messageReactionRemoveAll( LoggingEmojis.Expression } Reactions purged on [message](<${message.url}>) by ${message.author.toString()} in ${message.channel.toString()}`, LogSeverity.ContentEdit, - { - embeds: [ - { - fields: reactions.map((reaction) => ({ - name: reaction.emoji.toString(), - value: `${reaction.count} reaction${reaction.count === 1 ? "" : "s"}`, - inline: true, - })), - color: Colors.Blurple, - }, - ], - }, + reactions.size ? + { + embeds: [ + { + fields: reactions.map((reaction) => ({ + name: reaction.emoji.toString(), + value: `${reaction.count} reaction${reaction.count === 1 ? "" : "s"}`, + inline: true, + })), + color: Colors.Blurple, + }, + ], + } + : {}, ); } export async function messageUpdate( diff --git a/modules/threads/index.ts b/modules/threads/index.ts index 8ee73349c..5e10a7b85 100644 --- a/modules/threads/index.ts +++ b/modules/threads/index.ts @@ -6,6 +6,7 @@ import { getThreadConfig, threadsDatabase } from "./misc.js"; import { syncMembers, updateMemberThreads, updateThreadMembers } from "./sync-members.js"; import { mentionUser } from "../settings.js"; import config from "../../common/config.js"; +import features from "../../common/features.js"; defineEvent("threadCreate", async (thread) => { if (thread.type === ChannelType.PrivateThread) return; @@ -28,7 +29,7 @@ defineSubcommands( description: "Manage threads", restricted: true, access: - process.env.NODE_ENV === "production" ? + features.threadsTestingServer && process.env.NODE_ENV === "production" ? ["@defaults", config.guilds.testing.id] : undefined, subcommands: { diff --git a/package-lock.json b/package-lock.json index c503cabcb..c4efac0a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "scradd", - "version": "3.0.3", + "version": "3.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "scradd", - "version": "3.0.3", + "version": "3.0.4", "dependencies": { "@fontsource-variable/sora": "5.0.18", "@khanacademy/simple-markdown": "0.12.0", diff --git a/package.json b/package.json index c182dbbe5..c32fc17f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scradd", - "version": "3.0.3", + "version": "3.0.4", "private": true, "homepage": "https://discord.gg/FPv957V6SD", "type": "module",