Potential final fix for #30
This commit is contained in:
@@ -25,7 +25,7 @@ async function joinServerWrapper(presetName, channelId, connections) {
|
||||
});
|
||||
|
||||
// Check which nodes have the selected preset
|
||||
onlineNodes = onlineNodes.filter(node => node.nearbySystems.includes(presetName));
|
||||
onlineNodes = onlineNodes.filter(node => node.presets.includes(presetName));
|
||||
log.DEBUG("Filtered Online Nodes: ", onlineNodes);
|
||||
|
||||
// Check if any nodes with this preset are available
|
||||
@@ -113,10 +113,7 @@ module.exports = {
|
||||
var presetsAvailable = [];
|
||||
for (const nodeObject of nodeObjects) {
|
||||
log.DEBUG("Node object: ", nodeObject);
|
||||
for (const presetName in nodeObject.nearbySystems) {
|
||||
if (!isNaN(presetName)) presetsAvailable.push(nodeObject.nearbySystems[presetName]);
|
||||
else presetsAvailable.push(presetName)
|
||||
}
|
||||
presetsAvailable.push.apply(presetsAvailable, nodeObject.presets);
|
||||
}
|
||||
|
||||
log.DEBUG("All Presets available: ", presetsAvailable);
|
||||
@@ -133,7 +130,7 @@ module.exports = {
|
||||
try{
|
||||
const guildId = interaction.guild.id;
|
||||
const presetName = interaction.options.getString('preset');
|
||||
if (!interaction.member.voice.channel.id) return interaction.editReply(`You need to be in a voice channel, ${interaction.user}`)
|
||||
if (!interaction.member.voice.channel) return interaction.editReply(`You need to be in a voice channel, ${interaction.user}`)
|
||||
const channelId = interaction.member.voice.channel.id;
|
||||
log.DEBUG(`Join requested by: ${interaction.user.username}, to: '${presetName}', in channel: ${channelId} / ${guildId}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user