Skip to content

Commit cf1e858

Browse files
committed
use encoded group name
1 parent 12b1a7b commit cf1e858

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/controllers/groupInvite.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ export async function groupInvite(
1515
return discordTextResponse(`<@&${roleId}> is not a valid group.`);
1616
}
1717

18-
const groupName = group.name.replace(/^group-/, "");
18+
const groupName = group.name.replace(/^group-/, "").replace(/-/g, " ");
19+
const encodedGroupName = encodeURIComponent(groupName);
1920

2021
return discordTextResponse(
2122
`<@${userId}> join the group <@&${roleId}> via the link below:\n ${
2223
config(env).DASHBOARD_SITE_URL
23-
}/groups/?dev=true&name=${groupName}`
24+
}/groups/?dev=true&name=${encodedGroupName}`
2425
);
2526
}

0 commit comments

Comments
 (0)