From e347944b997dd1dd808cb1cc5df388e4a9bba85e Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Tue, 29 Dec 2020 15:34:41 +0200 Subject: Add Discord bot token constant from environment --- backend/constants.py | 1 + 1 file changed, 1 insertion(+) (limited to 'backend/constants.py') diff --git a/backend/constants.py b/backend/constants.py index fedab64..d9d2735 100644 --- a/backend/constants.py +++ b/backend/constants.py @@ -23,6 +23,7 @@ FORMS_BACKEND_DSN = os.getenv("FORMS_BACKEND_DSN") DOCS_PASSWORD = os.getenv("DOCS_PASSWORD") SECRET_KEY = os.getenv("SECRET_KEY", binascii.hexlify(os.urandom(30)).decode()) +DISCORD_BOT_TOKEN = os.getenv("DISCORD_BOT_TOKEN") HCAPTCHA_API_SECRET = os.getenv("HCAPTCHA_API_SECRET") -- cgit v1.2.3 From 5ced1c97d9553528b32d84ac819f53dffa0419b8 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Tue, 29 Dec 2020 15:38:26 +0200 Subject: Add ASSIGN_ROLE flag to schema and to enum --- SCHEMA.md | 1 + backend/constants.py | 1 + 2 files changed, 2 insertions(+) (limited to 'backend/constants.py') diff --git a/SCHEMA.md b/SCHEMA.md index c3edf35..11b4b89 100644 --- a/SCHEMA.md +++ b/SCHEMA.md @@ -31,6 +31,7 @@ In this document: | `COLLECT_EMAIL` | The form should collect the email from submissions. Requires `REQUIRES_LOGIN` | | `DISABLE_ANTISPAM` | Disable the anti-spam checks from running on a form submission. | | `WEBHOOK_ENABLED` | The form should notify the webhook. Has no effect if no webhook is set. | +| `ASSIGN_ROLE` | The form should assign role to user. Requires `REQUIRES_LOGIN`. | ### Webhooks Discord webhooks to send information upon form submission. diff --git a/backend/constants.py b/backend/constants.py index d9d2735..e6ff127 100644 --- a/backend/constants.py +++ b/backend/constants.py @@ -66,6 +66,7 @@ class FormFeatures(Enum): COLLECT_EMAIL = "COLLECT_EMAIL" DISABLE_ANTISPAM = "DISABLE_ANTISPAM" WEBHOOK_ENABLED = "WEBHOOK_ENABLED" + ASSIGN_ROLE = "ASSIGN_ROLE" class WebHook(Enum): -- cgit v1.2.3 From ba176f044adf1cf2b9c884830fe4f4d1cd5bbe9f Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Tue, 29 Dec 2020 18:31:22 +0200 Subject: Add Discord API base URL constant --- backend/constants.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'backend/constants.py') diff --git a/backend/constants.py b/backend/constants.py index e6ff127..fda92b9 100644 --- a/backend/constants.py +++ b/backend/constants.py @@ -56,6 +56,8 @@ REQUIRED_QUESTION_TYPE_DATA = { }, } +DISCORD_API_BASE_URL = "https://discord.com/api/v8" + class FormFeatures(Enum): """Lists form features. Read more in SCHEMA.md.""" -- cgit v1.2.3 From 68a753f4b79b46eb2c10f6177e4e717a143c4b22 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Tue, 29 Dec 2020 18:32:24 +0200 Subject: Add PyDis guild constant from environment --- backend/constants.py | 1 + 1 file changed, 1 insertion(+) (limited to 'backend/constants.py') diff --git a/backend/constants.py b/backend/constants.py index fda92b9..70f3df1 100644 --- a/backend/constants.py +++ b/backend/constants.py @@ -24,6 +24,7 @@ DOCS_PASSWORD = os.getenv("DOCS_PASSWORD") SECRET_KEY = os.getenv("SECRET_KEY", binascii.hexlify(os.urandom(30)).decode()) DISCORD_BOT_TOKEN = os.getenv("DISCORD_BOT_TOKEN") +DISCORD_GUILD = os.getenv("DISCORD_GUILD") HCAPTCHA_API_SECRET = os.getenv("HCAPTCHA_API_SECRET") -- cgit v1.2.3 From 4bce32330ecd298e610e4249e327ddb502542844 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Tue, 29 Dec 2020 19:31:01 +0200 Subject: Add default value to guild ID --- backend/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/constants.py') diff --git a/backend/constants.py b/backend/constants.py index 70f3df1..812bef4 100644 --- a/backend/constants.py +++ b/backend/constants.py @@ -24,7 +24,7 @@ DOCS_PASSWORD = os.getenv("DOCS_PASSWORD") SECRET_KEY = os.getenv("SECRET_KEY", binascii.hexlify(os.urandom(30)).decode()) DISCORD_BOT_TOKEN = os.getenv("DISCORD_BOT_TOKEN") -DISCORD_GUILD = os.getenv("DISCORD_GUILD") +DISCORD_GUILD = os.getenv("DISCORD_GUILD", 267624335836053506) HCAPTCHA_API_SECRET = os.getenv("HCAPTCHA_API_SECRET") -- cgit v1.2.3