diff options
| author | Fuwn <[email protected]> | 2025-10-01 21:04:29 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-10-01 21:04:29 -0700 |
| commit | c2ba8c2c4b2d0bde82149a357e616f582fc92e28 (patch) | |
| tree | 6e0bd86f18a17376f6e2588aa37471c23485b3de /packages/interactions/server.ts | |
| parent | feat(interactions): Add nsfw-apply command (diff) | |
| download | umabotdiscord-c2ba8c2c4b2d0bde82149a357e616f582fc92e28.tar.xz umabotdiscord-c2ba8c2c4b2d0bde82149a357e616f582fc92e28.zip | |
feat(interactions): Support GIFs in audit logs
Diffstat (limited to 'packages/interactions/server.ts')
| -rw-r--r-- | packages/interactions/server.ts | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/packages/interactions/server.ts b/packages/interactions/server.ts index 29245b6..d120f1a 100644 --- a/packages/interactions/server.ts +++ b/packages/interactions/server.ts @@ -518,13 +518,15 @@ router.post("/", async (request: Request, environment: Environment) => { case NSFW_APPLY_COMMAND.name.toLowerCase(): { try { - const applicationMessage = interaction.data.options?.[0]?.value as string; + const applicationMessage = interaction.data.options?.[0] + ?.value as string; if (!applicationMessage) return new JSONResponse({ type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, data: { - content: "❌ Please provide a message for your NSFW access application.", + content: + "❌ Please provide a message for your NSFW access application.", flags: 64, }, }); @@ -546,7 +548,10 @@ router.post("/", async (request: Request, environment: Environment) => { Date.now(), isDM, ); - const success = await sendNSFWApplicationToChannel(environment, applicationEmbed); + const success = await sendNSFWApplicationToChannel( + environment, + applicationEmbed, + ); if (success) { return new JSONResponse({ @@ -573,7 +578,8 @@ router.post("/", async (request: Request, environment: Environment) => { return new JSONResponse({ type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, data: { - content: "❌ An error occurred while processing your NSFW access application.", + content: + "❌ An error occurred while processing your NSFW access application.", flags: 64, }, }); @@ -798,11 +804,21 @@ router.post("/", async (request: Request, environment: Environment) => { const hasAdminPermission = member?.permissions && (parseInt(member.permissions) & 0x8) === 0x8; const hasOwnerRole = member?.roles?.includes(OWNER_ROLE_ID); - const hasAdministratorRole = member?.roles?.includes(ADMINISTRATOR_ROLE_ID); + const hasAdministratorRole = member?.roles?.includes( + ADMINISTRATOR_ROLE_ID, + ); const hasModeratorRole = member?.roles?.includes(MODERATOR_ROLE_ID); - const hasTrialModeratorRole = member?.roles?.includes(TRIAL_MODERATOR_ROLE_ID); + const hasTrialModeratorRole = member?.roles?.includes( + TRIAL_MODERATOR_ROLE_ID, + ); - if (!hasAdminPermission && !hasOwnerRole && !hasAdministratorRole && !hasModeratorRole && !hasTrialModeratorRole) + if ( + !hasAdminPermission && + !hasOwnerRole && + !hasAdministratorRole && + !hasModeratorRole && + !hasTrialModeratorRole + ) return new JSONResponse({ type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, data: { @@ -847,7 +863,8 @@ router.post("/", async (request: Request, environment: Environment) => { const targetMember = await guild.json(); const currentRoles = targetMember.roles || []; - const targetRoleId = access === "art_media" ? ART_MEDIA_ROLE_ID : ROLEPLAY_NSFW_ROLE_ID; + const targetRoleId = + access === "art_media" ? ART_MEDIA_ROLE_ID : ROLEPLAY_NSFW_ROLE_ID; const hasRole = currentRoles.includes(targetRoleId); let actionTaken = ""; let newRoles = [...currentRoles]; @@ -918,7 +935,8 @@ router.post("/", async (request: Request, environment: Environment) => { }); } - const accessTypeName = access === "art_media" ? "Art & Media" : "Roleplay NSFW"; + const accessTypeName = + access === "art_media" ? "Art & Media" : "Roleplay NSFW"; return new JSONResponse({ type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, |