Skip to content

Commit

Permalink
turn DISCORD_ROLE_ID into an allowlist (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid authored Jun 22, 2024
1 parent 3353f6e commit b17a349
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (!RAW_DISCORD_ROLE_ID) {
/**
* DISCORD_ROLE_ID is the Discord board role ID.
*/
export const DISCORD_ROLE_ID = RAW_DISCORD_ROLE_ID;
export const DISCORD_ROLE_ID = RAW_DISCORD_ROLE_ID.split(",");

const RAW_GITHUB_TOKEN = Deno.env.get("GITHUB_TOKEN");
if (!RAW_GITHUB_TOKEN) {
Expand Down
4 changes: 3 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export async function main() {
}

if (
!interaction.member.roles.some((role) => DISCORD_ROLE_ID === role)
!interaction.member.roles.some((role) =>
DISCORD_ROLE_ID.includes(role)
)
) {
return {
type: InteractionResponseType.ChannelMessageWithSource,
Expand Down

0 comments on commit b17a349

Please sign in to comment.