Skip to content

Commit 7cc0e36

Browse files
committed
added the group id to config file and added more info to the async processing comment
1 parent dd153f3 commit 7cc0e36

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

config/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ export function loadEnv(env: env, fromWorkerEnv: boolean): env {
5656
IDENTITY_SERVICE_PUBLIC_KEY: fromWorkerEnv
5757
? env.IDENTITY_SERVICE_PUBLIC_KEY
5858
: process.env.IDENTITY_SERVICE_PUBLIC_KEY || "",
59+
AWS_READ_ACCESS_GROUP_ID: fromWorkerEnv
60+
? env.AWS_READ_ACCESS_GROUP_ID
61+
: process.env.AWS_READ_ACCESS_GROUP_ID || "",
5962
};
6063
return Env;
6164
}

src/constants/commands.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import { config } from "dotenv";
2-
3-
config();
4-
51
export const HELLO = {
62
name: "hello",
73
description: "Replies with hello in the channel",
@@ -49,7 +45,7 @@ export const GRANT_AWS_ACCESS = {
4945
choices: [
5046
{
5147
name: "AWS read access",
52-
value: process.env.AWS_read_access_group_id,
48+
value: process.env.AWS_READ_ACCESS_GROUP_ID,
5349
},
5450
],
5551
},

src/utils/awsAccess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export async function grantAWSAccess(
8383
ctx: ExecutionContext,
8484
channelId: number
8585
) {
86-
// Immediately send a Discord response to acknowledge the command
86+
// Immediately send a Discord response to acknowledge the command, as the cloudfare workers have a limit of response time equals to 3s
8787
const initialResponse = discordTextResponse(
8888
`<@${discordUserId}> Processing your request to grant AWS access.`
8989
);

0 commit comments

Comments
 (0)