generated from nhcarrigan/template
Compare commits
5 Commits
main
..
a074449d0f
| Author | SHA1 | Date | |
|---|---|---|---|
|
a074449d0f
|
|||
|
ee796b6e57
|
|||
|
b5d29025b3
|
|||
|
1c4bc9ca03
|
|||
|
0db0d220cc
|
@@ -11,7 +11,7 @@ import {
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
} from "discord.js";
|
||||
import { adminUsers } from "../config/entitlements.js";
|
||||
import { naomiId } from "../config/entitlements.js";
|
||||
import { errorHandler } from "../utils/errorHandler.js";
|
||||
import type { Command } from "../interfaces/command.js";
|
||||
|
||||
@@ -24,9 +24,9 @@ import type { Command } from "../interfaces/command.js";
|
||||
// eslint-disable-next-line max-lines-per-function -- Modal requires many input components
|
||||
export const announcement: Command = async(_hikari, interaction) => {
|
||||
try {
|
||||
if (!adminUsers.includes(interaction.user.id)) {
|
||||
if (interaction.user.id !== naomiId) {
|
||||
await interaction.reply({
|
||||
content: "This command is restricted to administrators.",
|
||||
content: "This command is restricted to the owner.",
|
||||
ephemeral: true,
|
||||
});
|
||||
return;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
const naomiId = "465650873650118659";
|
||||
const rhiaId = "1086567250145841252";
|
||||
|
||||
const entitledGuilds = [
|
||||
"1354624415861833870",
|
||||
@@ -12,9 +11,4 @@ const entitledGuilds = [
|
||||
|
||||
const entitledUsers = [ naomiId ];
|
||||
|
||||
/**
|
||||
* User IDs allowed to run administrative commands.
|
||||
*/
|
||||
const adminUsers = [ naomiId, rhiaId ];
|
||||
|
||||
export { adminUsers, entitledGuilds, entitledUsers, naomiId };
|
||||
export { entitledGuilds, entitledUsers, naomiId };
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
<hr />
|
||||
<a routerLink="/settings" class="nav-link">Settings</a>
|
||||
<hr />
|
||||
<a href="https://chat.nhcarrigan.com" target="_blank" class="nav-link">Chat</a>
|
||||
<hr />
|
||||
<a href="https://support.nhcarrigan.com" target="_blank" class="nav-link">Support</a>
|
||||
<a routerLink="/chat" class="nav-link">Chat</a>
|
||||
<hr />
|
||||
</div>
|
||||
<i class="fa-solid fa-bars" *ngIf="!navOpen" (click)="toggleNav()"></i>
|
||||
|
||||
@@ -31,8 +31,6 @@ export class Sanctions {
|
||||
|
||||
private async loadSanctions(): Promise<void> {
|
||||
const sanctions = await this.sanctionsService.getSanctions();
|
||||
this.sanctions = sanctions.sort((a, b) => {
|
||||
return b.number - a.number;
|
||||
});
|
||||
this.sanctions = sanctions.sort((a, b) => b.number - a.number);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
"@nhcarrigan/eslint-config": "5.2.0",
|
||||
"@nhcarrigan/typescript-config": "4.0.0",
|
||||
"eslint": "9.30.1",
|
||||
"turbo": "2.8.12",
|
||||
"turbo": "2.8.11",
|
||||
"typescript": "5.8.3"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+29
-29
@@ -18,8 +18,8 @@ importers:
|
||||
specifier: 9.30.1
|
||||
version: 9.30.1(jiti@2.4.2)
|
||||
turbo:
|
||||
specifier: 2.8.12
|
||||
version: 2.8.12
|
||||
specifier: 2.8.11
|
||||
version: 2.8.11
|
||||
typescript:
|
||||
specifier: 5.8.3
|
||||
version: 5.8.3
|
||||
@@ -4618,38 +4618,38 @@ packages:
|
||||
resolution: {integrity: sha512-3T3T04WzowbwV2FDiGXBbr81t64g1MUGGJRgT4x5o97N+8ArdhVCAF9IxFrxuSJmM3E5Asn7nKHkao0ibcZXAg==}
|
||||
engines: {node: ^18.17.0 || >=20.5.0}
|
||||
|
||||
turbo-darwin-64@2.8.12:
|
||||
resolution: {integrity: sha512-EiHJmW2MeQQx+21x8hjMHw/uPhXt9PIxvDrxzOtyVwrXzL0tQmsxtO4qHf2l7uA+K6PUJ4+TjY1MHZDuCvWXrw==}
|
||||
turbo-darwin-64@2.8.11:
|
||||
resolution: {integrity: sha512-XKaCWaz4OCt77oYYvGCIRpvYD4c/aNaKjRkUpv+e8rN3RZb+5Xsyew4yRO+gaHdMIUhQznXNXfHlhs+/p7lIhA==}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
turbo-darwin-arm64@2.8.12:
|
||||
resolution: {integrity: sha512-cbqqGN0vd7ly2TeuaM8k9AK9u1CABO4kBA5KPSqovTiLL3sORccn/mZzJSbvQf0EsYRfU34MgW5FotfwW3kx8Q==}
|
||||
turbo-darwin-arm64@2.8.11:
|
||||
resolution: {integrity: sha512-VvynLHGUNvQ9k7GZjRPSsRcK4VkioTfFb7O7liAk4nHKjEcMdls7GqxzjVWgJiKz3hWmQGaP9hRa9UUnhVWCxA==}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
turbo-linux-64@2.8.12:
|
||||
resolution: {integrity: sha512-jXKw9j4r4q6s0goSXuKI3aKbQK2qiNeP25lGGEnq018TM6SWRW1CCpPMxyG91aCKrub7wDm/K45sGNT4ZFBcFQ==}
|
||||
turbo-linux-64@2.8.11:
|
||||
resolution: {integrity: sha512-cbSn37dcm+EmkQ7DD0euy7xV7o2el4GAOr1XujvkAyKjjNvQ+6QIUeDgQcwAx3D17zPpDvfDMJY2dLQadWnkmQ==}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
turbo-linux-arm64@2.8.12:
|
||||
resolution: {integrity: sha512-BRJCMdyXjyBoL0GYpvj9d2WNfMHwc3tKmJG5ATn2Efvil9LsiOsd/93/NxDqW0jACtHFNVOPnd/CBwXRPiRbwA==}
|
||||
turbo-linux-arm64@2.8.11:
|
||||
resolution: {integrity: sha512-+trymp2s2aBrhS04l6qFxcExzZ8ffndevuUB9c5RCeqsVpZeiWuGQlWNm5XjOmzoMayxRARZ5ma7yiWbGMiLqQ==}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
turbo-windows-64@2.8.12:
|
||||
resolution: {integrity: sha512-vyFOlpFFzQFkikvSVhVkESEfzIopgs2J7J1rYvtSwSHQ4zmHxkC95Q8Kjkus8gg+8X2mZyP1GS5jirmaypGiPw==}
|
||||
turbo-windows-64@2.8.11:
|
||||
resolution: {integrity: sha512-3kJjFSM4yw1n9Uzmi+XkAUgCae19l/bH6RJ442xo7mnZm0tpOjo33F+FYHoSVpIWVMd0HG0LDccyafPSdylQbA==}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
turbo-windows-arm64@2.8.12:
|
||||
resolution: {integrity: sha512-9nRnlw5DF0LkJClkIws1evaIF36dmmMEO84J5Uj4oQ8C0QTHwlH7DNe5Kq2Jdmu8GXESCNDNuUYG8Cx6W/vm3g==}
|
||||
turbo-windows-arm64@2.8.11:
|
||||
resolution: {integrity: sha512-JOM4uF2vuLsJUvibdR6X9QqdZr6BhC6Nhlrw4LKFPsXZZI/9HHLoqAiYRpE4MuzIwldCH/jVySnWXrI1SKto0g==}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
turbo@2.8.12:
|
||||
resolution: {integrity: sha512-auUAMLmi0eJhxDhQrxzvuhfEbICnVt0CTiYQYY8WyRJ5nwCDZxD0JG8bCSxT4nusI2CwJzmZAay5BfF6LmK7Hw==}
|
||||
turbo@2.8.11:
|
||||
resolution: {integrity: sha512-H+rwSHHPLoyPOSoHdmI1zY0zy0GGj1Dmr7SeJW+nZiWLz2nex8EJ+fkdVabxXFMNEux+aywI4Sae8EqhmnOv4A==}
|
||||
hasBin: true
|
||||
|
||||
twitter-api-v2@1.28.0:
|
||||
@@ -10192,32 +10192,32 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
turbo-darwin-64@2.8.12:
|
||||
turbo-darwin-64@2.8.11:
|
||||
optional: true
|
||||
|
||||
turbo-darwin-arm64@2.8.12:
|
||||
turbo-darwin-arm64@2.8.11:
|
||||
optional: true
|
||||
|
||||
turbo-linux-64@2.8.12:
|
||||
turbo-linux-64@2.8.11:
|
||||
optional: true
|
||||
|
||||
turbo-linux-arm64@2.8.12:
|
||||
turbo-linux-arm64@2.8.11:
|
||||
optional: true
|
||||
|
||||
turbo-windows-64@2.8.12:
|
||||
turbo-windows-64@2.8.11:
|
||||
optional: true
|
||||
|
||||
turbo-windows-arm64@2.8.12:
|
||||
turbo-windows-arm64@2.8.11:
|
||||
optional: true
|
||||
|
||||
turbo@2.8.12:
|
||||
turbo@2.8.11:
|
||||
optionalDependencies:
|
||||
turbo-darwin-64: 2.8.12
|
||||
turbo-darwin-arm64: 2.8.12
|
||||
turbo-linux-64: 2.8.12
|
||||
turbo-linux-arm64: 2.8.12
|
||||
turbo-windows-64: 2.8.12
|
||||
turbo-windows-arm64: 2.8.12
|
||||
turbo-darwin-64: 2.8.11
|
||||
turbo-darwin-arm64: 2.8.11
|
||||
turbo-linux-64: 2.8.11
|
||||
turbo-linux-arm64: 2.8.11
|
||||
turbo-windows-64: 2.8.11
|
||||
turbo-windows-arm64: 2.8.11
|
||||
|
||||
twitter-api-v2@1.28.0: {}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ Platform-specific requirements:
|
||||
- Include clear calls to action
|
||||
- The same content will be used for Discord, Reddit, Ko-fi, and Patreon, so make it work well for all these platforms
|
||||
|
||||
**Threaded (for Twitter, Bluesky, and Mastodon):**
|
||||
**Threaded (for Threads, Twitter, Bluesky, and Mastodon):**
|
||||
- Break content into a thread of individual posts
|
||||
- Each post should be under 280 characters (to work for Twitter's limit, which is the most restrictive)
|
||||
- Posts should flow naturally from one to the next
|
||||
@@ -32,14 +32,14 @@ Platform-specific requirements:
|
||||
- Make the first post compelling to encourage thread reading
|
||||
- Do NOT include post numbers or thread indicators (e.g., "1/5" or "đź§µ")
|
||||
- Plain text format (no markdown)
|
||||
- The same thread will be used for Twitter, Bluesky, and Mastodon
|
||||
- The same thread will be used for Threads, Twitter, Bluesky, and Mastodon
|
||||
|
||||
**Plaintext (for LinkedIn and Facebook):**
|
||||
**Plaintext (for LinkedIn, Facebook, and Peerlist):**
|
||||
- Plain text format (no markdown)
|
||||
- Professional yet friendly tone, conversational style suitable for a broader audience
|
||||
- Include 3-5 relevant hashtags
|
||||
- Keep it concise but informative
|
||||
- The same content will be used for LinkedIn and Facebook
|
||||
- The same content will be used for LinkedIn, Facebook, and Peerlist
|
||||
|
||||
**Universal requirements:**
|
||||
- All announcements must include a call to action to donate (https://donate.nhcarrigan.com)
|
||||
@@ -71,13 +71,13 @@ const announcementJsonSchema = {
|
||||
type: "object",
|
||||
},
|
||||
plaintext: {
|
||||
description: "Plain text announcement for LinkedIn and Facebook (shared content). Should be professional yet friendly, conversational style suitable for a broader audience. Include 3-5 relevant hashtags and calls to action for donating and joining Discord.",
|
||||
description: "Plain text announcement for LinkedIn, Facebook, and Peerlist (shared content). Should be professional yet friendly, conversational style suitable for a broader audience. Include 3-5 relevant hashtags and calls to action for donating and joining Discord.",
|
||||
maxLength: 1900,
|
||||
minLength: 100,
|
||||
type: "string",
|
||||
},
|
||||
threaded: {
|
||||
description: "Array of individual posts that form a thread. Will be used for Twitter, Bluesky, and Mastodon. Each post should be under 280 characters (Twitter's limit) and flow naturally from one to the next.",
|
||||
description: "Array of individual posts that form a thread. Will be used for Threads, Twitter, Bluesky, and Mastodon. Each post should be under 280 characters (Twitter's limit) and flow naturally from one to the next.",
|
||||
items: {
|
||||
description: "A single post in the thread (max 280 characters, no post numbers or thread indicators)",
|
||||
maxLength: 280,
|
||||
|
||||
@@ -12,6 +12,7 @@ import { announceOnDiscourse } from "../modules/announceOnDiscourse.js";
|
||||
import { announceOnFacebook } from "../modules/announceOnFacebook.js";
|
||||
import { announceOnMastodon } from "../modules/announceOnMastodon.js";
|
||||
import { announceOnReddit } from "../modules/announceOnReddit.js";
|
||||
import { announceOnThreads } from "../modules/announceOnThreads.js";
|
||||
import { announceOnTwitter } from "../modules/announceOnTwitter.js";
|
||||
import { generateAnnouncements } from "../modules/generateAnnouncements.js";
|
||||
import { getIpFromRequest } from "../modules/getIpFromRequest.js";
|
||||
@@ -115,6 +116,7 @@ export const announcementRoutes: FastifyPluginAsync = async(server) => {
|
||||
blueskyResult,
|
||||
twitterResult,
|
||||
facebookResult,
|
||||
threadsResult,
|
||||
mastodonResult,
|
||||
discourseResult,
|
||||
] = await Promise.allSettled([
|
||||
@@ -123,14 +125,15 @@ export const announcementRoutes: FastifyPluginAsync = async(server) => {
|
||||
announceOnBluesky(threaded),
|
||||
announceOnTwitter(threaded),
|
||||
announceOnFacebook(plaintext),
|
||||
announceOnThreads(threaded),
|
||||
announceOnMastodon(threaded),
|
||||
announceOnDiscourse(markdownTitle, markdownContent, type),
|
||||
]);
|
||||
|
||||
return await reply.status(201).send({
|
||||
alert: `Please remember to manually post to: LinkedIn, Ko-fi, and Patreon.`,
|
||||
alert: `Please remember to manually post to: LinkedIn, Peerlist, Ko-fi, and Patreon.`,
|
||||
cost: announcement.cost,
|
||||
message: `Announcement processed. Discord: ${getPlatformResult(discordResult)}, Reddit: ${getPlatformResult(redditResult)}, Bluesky: ${getPlatformResult(blueskyResult)}, Twitter: ${getPlatformResult(twitterResult)}, Facebook: ${getPlatformResult(facebookResult)}, Mastodon: ${getPlatformResult(mastodonResult)}, Discourse: ${getPlatformResult(discourseResult)}`,
|
||||
message: `Announcement processed. Discord: ${getPlatformResult(discordResult)}, Reddit: ${getPlatformResult(redditResult)}, Bluesky: ${getPlatformResult(blueskyResult)}, Twitter: ${getPlatformResult(twitterResult)}, Facebook: ${getPlatformResult(facebookResult)}, Threads: ${getPlatformResult(threadsResult)}, Mastodon: ${getPlatformResult(mastodonResult)}, Discourse: ${getPlatformResult(discourseResult)}`,
|
||||
rawPost: announcement.response,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user