Conversation
|
this issue #24 |
まだマージ不可 |
There was a problem hiding this comment.
Pull request overview
This PR updates the bot configuration and adjusts permission overwrites for dynamically created voice channels so that members with a specific “member” role can view/connect, while @everyone is restricted for privacy.
Changes:
- Add
role.memberIdtobot.config.tsfor member-role-based permissions. - Update VC auto-creation in
src/handlers/events/vc/join.tsto grantmemberIdView/Connect and then deny@everyoneViewChannel. - Refresh some dependencies in
package-lock.json.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/handlers/events/vc/join.ts | Adds member-role allow overwrites and applies an @everyone visibility restriction for new VCs. |
| bot.config.ts | Adds a configured member role ID (memberId) used by VC permission logic. |
| package-lock.json | Dependency lockfile updates (diff/lodash). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }, | ||
| { | ||
| id: newState.member?.id || newState.member?.user.id || "", | ||
| allow: [ |
There was a problem hiding this comment.
newState.member can be null on VoiceState (e.g., partials). In that case this code will pass an empty string as the overwrite id, which will cause the channel create call to fail (and also produce a channel name with undefined). Add an early guard (e.g., return if !newState.member) and use newState.member.id directly instead of falling back to "".
|
|
||
| await newState.member?.voice.setChannel(channel); | ||
| await channel.permissionOverwrites.create(newState.guild.roles.everyone, { | ||
| ViewChannel: false, | ||
| }); | ||
| } catch (error) { |
There was a problem hiding this comment.
The @everyone deny is applied after the channel is created and after moving the member into it. That leaves a window where the new channel may be visible/joinable based on guild default permissions, which undermines the privacy goal. Prefer including the @everyone deny overwrite directly in the initial permissionOverwrites passed to channels.create (and then you can drop the extra API call).
This pull request updates the bot's configuration and improves permission handling for dynamically created voice channels. The main changes include adding a member role ID to the configuration and refining how permissions are set when users join voice channels.
Bot configuration update:
memberIdto therolesection ofbotConfiginbot.config.tsto support member role permissions.Voice channel permission improvements:
vc/join.ts, added permission overwrites to allow members with the member role (memberId) to view and connect to the channel.@everyonerole to deny viewing the channel, ensuring privacy for the voice channel.