mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-20 16:25:03 +00:00
Allow kicking the user from VC on mute
If any non-id string is entered in `move_to_voice_channel`, the user is kicked from the VC instead of being moved. We do not automatically kick if the option is set to null in order to not make this a breaking change for old, intended behavior
This commit is contained in:
parent
6f545f5c4a
commit
f0a60fd385
1 changed files with 2 additions and 1 deletions
|
@ -89,9 +89,10 @@ export async function muteUser(
|
||||||
}
|
}
|
||||||
|
|
||||||
// If enabled, move the user to the mute voice channel (e.g. afk - just to apply the voice perms from the mute role)
|
// If enabled, move the user to the mute voice channel (e.g. afk - just to apply the voice perms from the mute role)
|
||||||
const moveToVoiceChannelId = pluginData.config.get().move_to_voice_channel;
|
let moveToVoiceChannelId = pluginData.config.get().move_to_voice_channel;
|
||||||
if (moveToVoiceChannelId) {
|
if (moveToVoiceChannelId) {
|
||||||
// TODO: Add back the voiceState check once we figure out how to get voice state for guild members that are loaded on-demand
|
// TODO: Add back the voiceState check once we figure out how to get voice state for guild members that are loaded on-demand
|
||||||
|
if (moveToVoiceChannelId.match(".*[^0-9].*")) moveToVoiceChannelId = null;
|
||||||
try {
|
try {
|
||||||
await member.edit({ channelID: moveToVoiceChannelId });
|
await member.edit({ channelID: moveToVoiceChannelId });
|
||||||
} catch (e) {} // tslint:disable-line
|
} catch (e) {} // tslint:disable-line
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue