Skip to content

Commit

Permalink
added the group id to config file and added more info to the async pr…
Browse files Browse the repository at this point in the history
…ocessing comment
  • Loading branch information
vikhyat187 committed Nov 11, 2024
1 parent dd153f3 commit 7cc0e36
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export function loadEnv(env: env, fromWorkerEnv: boolean): env {
IDENTITY_SERVICE_PUBLIC_KEY: fromWorkerEnv
? env.IDENTITY_SERVICE_PUBLIC_KEY
: process.env.IDENTITY_SERVICE_PUBLIC_KEY || "",
AWS_READ_ACCESS_GROUP_ID: fromWorkerEnv
? env.AWS_READ_ACCESS_GROUP_ID
: process.env.AWS_READ_ACCESS_GROUP_ID || "",
};
return Env;
}
Expand Down
6 changes: 1 addition & 5 deletions src/constants/commands.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { config } from "dotenv";

config();

export const HELLO = {
name: "hello",
description: "Replies with hello in the channel",
Expand Down Expand Up @@ -49,7 +45,7 @@ export const GRANT_AWS_ACCESS = {
choices: [
{
name: "AWS read access",
value: process.env.AWS_read_access_group_id,
value: process.env.AWS_READ_ACCESS_GROUP_ID,
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/utils/awsAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function grantAWSAccess(
ctx: ExecutionContext,
channelId: number
) {
// Immediately send a Discord response to acknowledge the command
// Immediately send a Discord response to acknowledge the command, as the cloudfare workers have a limit of response time equals to 3s
const initialResponse = discordTextResponse(
`<@${discordUserId}> Processing your request to grant AWS access.`
);
Expand Down

0 comments on commit 7cc0e36

Please sign in to comment.