mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
feat(gateway): add Discord external chat platform
This commit is contained in:
parent
78fbca1967
commit
4b8ca29f9e
2 changed files with 119 additions and 1 deletions
|
|
@ -578,6 +578,7 @@ class ExternalChatPlatform(StrEnum):
|
|||
TELEGRAM = "telegram"
|
||||
WHATSAPP = "whatsapp"
|
||||
SLACK = "slack"
|
||||
DISCORD = "discord"
|
||||
SIGNAL = "signal"
|
||||
|
||||
|
||||
|
|
@ -890,7 +891,9 @@ class ExternalChatAccount(Base, TimestampMixin):
|
|||
"platform",
|
||||
unique=True,
|
||||
postgresql_where=text(
|
||||
"is_system_account = true AND NOT (cursor_state ? 'team_id')"
|
||||
"is_system_account = true "
|
||||
"AND NOT (cursor_state ? 'team_id') "
|
||||
"AND NOT (cursor_state ? 'guild_id')"
|
||||
),
|
||||
),
|
||||
Index(
|
||||
|
|
@ -902,6 +905,15 @@ class ExternalChatAccount(Base, TimestampMixin):
|
|||
"is_system_account = true AND cursor_state ? 'team_id'"
|
||||
),
|
||||
),
|
||||
Index(
|
||||
"uq_external_chat_accounts_discord_guild",
|
||||
"platform",
|
||||
text("(cursor_state ->> 'guild_id')"),
|
||||
unique=True,
|
||||
postgresql_where=text(
|
||||
"is_system_account = true AND cursor_state ? 'guild_id'"
|
||||
),
|
||||
),
|
||||
Index(
|
||||
"uq_external_chat_accounts_webhook_secret",
|
||||
"webhook_secret",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue