File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 292292 "multipleChannelsFound" : " Multiple channels found: {channels}. Please provide a more precise name." ,
293293 "movedToChannel" : " Moved {count} player(s) to {channel}: {players}" ,
294294 "userNotInVoice" : " {user} is not in a voice channel." ,
295+ "userAlreadyInChannel" : " {user} is already in the target voice channel." ,
295296 "failedToMoveUser" : " Failed to move {user}." ,
296297 "couldNotFindCategory" : " Could not find category: {category}" ,
297298 "couldNotFindChannel" : " Could not find channel: {channel}" ,
Original file line number Diff line number Diff line change 292292 "multipleChannelsFound" : " Найдено несколько каналов: {channels}. Пожалуйста, укажите более точное название." ,
293293 "movedToChannel" : " Перемещено {count} игрок(а/ов) в {channel}: {players}" ,
294294 "userNotInVoice" : " {user} не находится в голосовом канале." ,
295+ "userAlreadyInChannel" : " {user} уже находится в целевом голосовом канале." ,
295296 "failedToMoveUser" : " Не удалось переместить {user}." ,
296297 "couldNotFindCategory" : " Не удалось найти категорию: {category}" ,
297298 "couldNotFindChannel" : " Не удалось найти канал: {channel}" ,
Original file line number Diff line number Diff line change @@ -1608,6 +1608,15 @@ class RustPlus extends RustPlusLib {
16081608 continue ;
16091609 }
16101610
1611+ // Check if user is already in the target channel
1612+ if ( member . voice . channelId === targetChannel . id ) {
1613+ results . failed . push ( {
1614+ name : member . displayName ,
1615+ reason : 'already_in_channel'
1616+ } ) ;
1617+ continue ;
1618+ }
1619+
16111620 try {
16121621 await member . voice . setChannel ( targetChannel ) ;
16131622 results . moved . push ( member . displayName ) ;
@@ -1634,7 +1643,8 @@ class RustPlus extends RustPlusLib {
16341643 if ( results . failed . length > 0 ) {
16351644 const failedMessages = results . failed . map ( f =>
16361645 Client . client . intlGet ( this . guildId ,
1637- f . reason === 'not_in_voice' ? 'userNotInVoice' : 'failedToMoveUser' ,
1646+ f . reason === 'not_in_voice' ? 'userNotInVoice' :
1647+ f . reason === 'already_in_channel' ? 'userAlreadyInChannel' : 'failedToMoveUser' ,
16381648 { user : f . name }
16391649 )
16401650 ) ;
You can’t perform that action at this time.
0 commit comments