generated from nhcarrigan/template
fix: correct announcement API endpoint and add optional content fields (#20)
## Summary - Fixes the announcement API URL from `/announcement` to `/api/announcement` - Adds three optional additional content text inputs (Parts 2–4) to the announcement modal - The bot concatenates all non-empty content fields with double newlines before forwarding to the API - Only the first content field and the category selector remain required ## Test Plan - [ ] Run `/announcement` and verify the modal opens with four content fields and a category selector - [ ] Submit with only the first content field filled — verify it sends correctly - [ ] Submit with multiple content fields filled — verify they are concatenated in the API request - [ ] Verify the API no longer returns HTTP 405 Reviewed-on: #20 Co-authored-by: Hikari <hikari@nhcarrigan.com> Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #20.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { entitledGuilds, entitledUsers } from "../config/entitlements.js";
|
||||
import { entitledGuilds, naomiId } from "../config/entitlements.js";
|
||||
import type { Client, Guild, User } from "discord.js";
|
||||
|
||||
/**
|
||||
@@ -17,7 +17,7 @@ const checkUserEntitlement = async(
|
||||
hikari: Client,
|
||||
user: User,
|
||||
): Promise<boolean> => {
|
||||
if (entitledUsers.includes(user.id)) {
|
||||
if (user.id === naomiId) {
|
||||
return true;
|
||||
}
|
||||
const entitlements = await hikari.application?.entitlements.fetch({
|
||||
|
||||
Reference in New Issue
Block a user