fix(discord): do not split each line into individual messages (#573)
Closes #519 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Notification destinations can now be tested even when disabled, enabling configuration validation before activation * **Improvements** * Discord notification formatting parameters optimized for enhanced message delivery <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
b916df7736
commit
29967d7e4e
2 changed files with 3 additions and 5 deletions
|
|
@ -13,6 +13,8 @@ export const buildDiscordShoutrrrUrl = (config: Extract<NotificationConfig, { ty
|
||||||
let shoutrrrUrl = `discord://${webhookToken}@${webhookId}`;
|
let shoutrrrUrl = `discord://${webhookToken}@${webhookId}`;
|
||||||
|
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
|
|
||||||
|
params.append("splitLines", "false");
|
||||||
if (config.username) {
|
if (config.username) {
|
||||||
params.append("username", config.username);
|
params.append("username", config.username);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { eq, and } from "drizzle-orm";
|
import { eq, and } from "drizzle-orm";
|
||||||
import { BadRequestError, ConflictError, InternalServerError, NotFoundError } from "http-errors-enhanced";
|
import { BadRequestError, InternalServerError, NotFoundError } from "http-errors-enhanced";
|
||||||
import { db } from "../../db/db";
|
import { db } from "../../db/db";
|
||||||
import {
|
import {
|
||||||
notificationDestinationsTable,
|
notificationDestinationsTable,
|
||||||
|
|
@ -229,10 +229,6 @@ const deleteDestination = async (id: number) => {
|
||||||
const testDestination = async (id: number) => {
|
const testDestination = async (id: number) => {
|
||||||
const destination = await getDestination(id);
|
const destination = await getDestination(id);
|
||||||
|
|
||||||
if (!destination.enabled) {
|
|
||||||
throw new ConflictError("Cannot test disabled notification destination");
|
|
||||||
}
|
|
||||||
|
|
||||||
const decryptedConfig = await decryptSensitiveFields(destination.config);
|
const decryptedConfig = await decryptSensitiveFields(destination.config);
|
||||||
|
|
||||||
const shoutrrrUrl = buildShoutrrrUrl(decryptedConfig);
|
const shoutrrrUrl = buildShoutrrrUrl(decryptedConfig);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue