mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(notification): Telegram add support for topics in groups (#894)
* feat(notification): send Telegram messages to a specific topic of a group * Convert settings.Topic to integer once and reuse it as part of the telegramSender struct. * feat(notifications): add migrations for topic * fix(notifications): find null string * fix(notifications): form initial values --------- Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
e5692fefc7
commit
fdc957c571
7 changed files with 60 additions and 16 deletions
|
@ -121,6 +121,11 @@ function FormFieldsTelegram() {
|
|||
label="Chat ID"
|
||||
help="Chat ID"
|
||||
/>
|
||||
<PasswordFieldWide
|
||||
name="topic"
|
||||
label="Message Thread ID"
|
||||
help="Message Thread (topic) of a Supergroup"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -436,6 +441,7 @@ interface InitialValues {
|
|||
api_key?: string;
|
||||
priority?: number;
|
||||
channel?: string;
|
||||
topic?: string;
|
||||
events: NotificationEvent[];
|
||||
}
|
||||
|
||||
|
@ -484,6 +490,7 @@ export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateP
|
|||
api_key: notification.api_key,
|
||||
priority: notification.priority,
|
||||
channel: notification.channel,
|
||||
topic: notification.topic,
|
||||
events: notification.events || []
|
||||
};
|
||||
|
||||
|
@ -567,4 +574,4 @@ export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateP
|
|||
)}
|
||||
</SlideOver>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
9
web/src/types/Notification.d.ts
vendored
9
web/src/types/Notification.d.ts
vendored
|
@ -4,7 +4,13 @@
|
|||
*/
|
||||
|
||||
type NotificationType = "DISCORD" | "NOTIFIARR" | "TELEGRAM" | "PUSHOVER";
|
||||
type NotificationEvent = "PUSH_APPROVED" | "PUSH_REJECTED" | "PUSH_ERROR" | "IRC_DISCONNECTED" | "IRC_RECONNECTED" | "APP_UPDATE_AVAILABLE";
|
||||
type NotificationEvent =
|
||||
"PUSH_APPROVED"
|
||||
| "PUSH_REJECTED"
|
||||
| "PUSH_ERROR"
|
||||
| "IRC_DISCONNECTED"
|
||||
| "IRC_RECONNECTED"
|
||||
| "APP_UPDATE_AVAILABLE";
|
||||
|
||||
interface Notification {
|
||||
id: number;
|
||||
|
@ -17,4 +23,5 @@ interface Notification {
|
|||
api_key?: string;
|
||||
channel?: string;
|
||||
priority?: number;
|
||||
topic?: string;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue