fix: Starboard
This commit is contained in:
@@ -747,6 +747,10 @@ export const commandLocales = {
|
||||
de: 'Self-Star erlauben',
|
||||
en: 'Allow self-star'
|
||||
},
|
||||
'starboard.status.description': {
|
||||
de: 'Aktuelle Starboard-Einstellungen anzeigen',
|
||||
en: 'Show current starboard settings'
|
||||
},
|
||||
'suggest.description': {
|
||||
de: 'Einen Vorschlag einreichen',
|
||||
en: 'Submit a suggestion'
|
||||
|
||||
@@ -514,17 +514,44 @@ export type TagDashboardUpdate = z.infer<typeof TagDashboardUpdateSchema>;
|
||||
// Starboard
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export const StarboardConfigDashboardSchema = z.object({
|
||||
enabled: z.boolean(),
|
||||
channelId: OptionalSnowflakeSchema,
|
||||
emoji: z.string().min(1).max(32),
|
||||
threshold: z.number().int().positive(),
|
||||
allowSelfStar: z.boolean(),
|
||||
ignoredChannelIds: z.array(z.string())
|
||||
});
|
||||
export const StarboardConfigDashboardSchema = z
|
||||
.object({
|
||||
enabled: z.boolean(),
|
||||
channelId: OptionalSnowflakeSchema,
|
||||
emoji: z.string().min(1).max(80),
|
||||
threshold: z.number().int().min(1).max(100),
|
||||
allowSelfStar: z.boolean(),
|
||||
ignoredChannelIds: z.array(SnowflakeSchema)
|
||||
})
|
||||
.superRefine((value, ctx) => {
|
||||
if (value.enabled && !value.channelId) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'channelId is required when starboard is enabled',
|
||||
path: ['channelId']
|
||||
});
|
||||
}
|
||||
});
|
||||
export type StarboardConfigDashboard = z.infer<typeof StarboardConfigDashboardSchema>;
|
||||
|
||||
export const StarboardConfigDashboardPatchSchema = nonEmptyPatch(StarboardConfigDashboardSchema);
|
||||
export const StarboardConfigDashboardPatchSchema = nonEmptyPatch(
|
||||
z.object({
|
||||
enabled: z.boolean(),
|
||||
channelId: OptionalSnowflakeSchema,
|
||||
emoji: z.string().min(1).max(80),
|
||||
threshold: z.number().int().min(1).max(100),
|
||||
allowSelfStar: z.boolean(),
|
||||
ignoredChannelIds: z.array(SnowflakeSchema)
|
||||
})
|
||||
).superRefine((value, ctx) => {
|
||||
if (value.enabled === true && value.channelId === '') {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
message: 'channelId is required when starboard is enabled',
|
||||
path: ['channelId']
|
||||
});
|
||||
}
|
||||
});
|
||||
export type StarboardConfigDashboardPatch = z.infer<typeof StarboardConfigDashboardPatchSchema>;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -339,12 +339,17 @@ const de: Dictionary = {
|
||||
'fun.cat.title': 'Random Cat',
|
||||
'fun.dog.title': 'Random Dog',
|
||||
'starboard.notConfigured': 'Starboard ist noch nicht konfiguriert. Nutze `/starboard setup`.',
|
||||
'starboard.invalidChannel': 'Der Starboard-Kanal ist ungültig.',
|
||||
'starboard.setupDone': 'Starboard konfiguriert.',
|
||||
'starboard.invalidChannel':
|
||||
'Der Starboard-Kanal ist ungültig oder dem Bot fehlen Rechte (Ansehen, Senden, Embeds).',
|
||||
'starboard.setupDone': 'Starboard konfiguriert und aktiviert.',
|
||||
'starboard.noContent': '*Kein Textinhalt*',
|
||||
'starboard.field.stars': 'Sterne',
|
||||
'starboard.field.source': 'Quelle',
|
||||
'starboard.jumpLink': 'Zur Nachricht',
|
||||
'starboard.statusLine':
|
||||
'Starboard aktiv → Kanal {channel}, Emoji {emoji}, Schwelle {threshold}, Self-Star: {selfStar}',
|
||||
'starboard.selfStarOn': 'erlaubt',
|
||||
'starboard.selfStarOff': 'verboten',
|
||||
'suggestion.created': 'Vorschlag eingereicht (ID: `{id}`).',
|
||||
'suggestion.setupDone': 'Vorschlagssystem konfiguriert.',
|
||||
'suggestion.staffUpdated': 'Vorschlag aktualisiert ({status}).',
|
||||
@@ -925,12 +930,17 @@ const en: Dictionary = {
|
||||
'fun.cat.title': 'Random Cat',
|
||||
'fun.dog.title': 'Random Dog',
|
||||
'starboard.notConfigured': 'Starboard is not configured yet. Use `/starboard setup`.',
|
||||
'starboard.invalidChannel': 'The starboard channel is invalid.',
|
||||
'starboard.setupDone': 'Starboard configured.',
|
||||
'starboard.invalidChannel':
|
||||
'The starboard channel is invalid or the bot lacks permissions (View, Send, Embed Links).',
|
||||
'starboard.setupDone': 'Starboard configured and enabled.',
|
||||
'starboard.noContent': '*No text content*',
|
||||
'starboard.field.stars': 'Stars',
|
||||
'starboard.field.source': 'Source',
|
||||
'starboard.jumpLink': 'Jump to message',
|
||||
'starboard.statusLine':
|
||||
'Starboard active → channel {channel}, emoji {emoji}, threshold {threshold}, self-star: {selfStar}',
|
||||
'starboard.selfStarOn': 'allowed',
|
||||
'starboard.selfStarOff': 'denied',
|
||||
'suggestion.created': 'Suggestion submitted (ID: `{id}`).',
|
||||
'suggestion.setupDone': 'Suggestion system configured.',
|
||||
'suggestion.staffUpdated': 'Suggestion updated ({status}).',
|
||||
|
||||
Reference in New Issue
Block a user