diff --git a/README.md b/README.md index 50ae906..0c7fbe4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Voice Manager v4.10.7 +## Voice Manager v4.10.8 Voice Manager diff --git a/libs/commands/exec.lua b/libs/commands/exec.lua index 9caa2b0..a1ee331 100644 --- a/libs/commands/exec.lua +++ b/libs/commands/exec.lua @@ -47,11 +47,11 @@ return function (interaction) end local fn, syntaxError = load(interaction.option.value, "Bot", "t", sandbox) - if not fn then return "Syntax error", warningEmbed:compose(interaction)(code(syntaxError))() end + if not fn then return "Syntax error", warningEmbed:compose(interaction)("asIs", code(syntaxError))() end local success, runtimeError = pcall(fn) - if not success then return "Runtime error", warningEmbed:compose(interaction)(code(runtimeError))() end + if not success then return "Runtime error", warningEmbed:compose(interaction)("asIs", code(runtimeError))() end lines = table.concat(lines, '\n') -- bring all the lines together - return "Code executed", okEmbed(interaction)(code(lines))() + return "Code executed", okEmbed:compose(interaction)("asIs", code(lines))() end \ No newline at end of file diff --git a/libs/events/voiceChannelJoin.lua b/libs/events/voiceChannelJoin.lua index c9454e6..48832aa 100644 --- a/libs/events/voiceChannelJoin.lua +++ b/libs/events/voiceChannelJoin.lua @@ -205,8 +205,8 @@ local function roomJoin (member, channel) } } - member:setVoiceChannel(newChannel) channels:store(newChannel.id, 3, member.user.id, channel.id, 0) + member:setVoiceChannel(newChannel) return member.user:send(passwordEmbed(member.user, channel)) end @@ -256,7 +256,6 @@ return function (member, channel) if limit == -1 then member:setVoiceChannel() member.user:send(warningEmbed(member.user, "wait", retryIn)) - processMutex:unlock() return end @@ -266,6 +265,7 @@ return function (member, channel) if not ok then error(string.format('failed to process a user %s joining lobby "%s"\n%s', member.user.id, channel.id, err)) end end elseif channels[channel.id] then + if channels[channel.id].parentType == 3 then return end if channels[channel.id].host ~= member.user.id then roomJoin(member, channel) end elseif guilds[channel.guild.id].permissions.bitfield.value ~= 0 then channelJoin(member, channel) diff --git a/libs/handlers/embedHandler.lua b/libs/handlers/embedHandler.lua index 9ef8936..baa0227 100644 --- a/libs/handlers/embedHandler.lua +++ b/libs/handlers/embedHandler.lua @@ -5,18 +5,20 @@ https://leovoel.github.io/embed-visualizer/ https://discord.com/developers/docs/resources/channel#embed-object ]] -local locale = "locale/runtime/localeHandler" +local locale = require "locale/runtime/localeHandler" local wrapper = { __call = function (self, ...) return self.factory(...) end } + -- this is so ugly :/ local composeMeta = { __call = function (self, msg, ...) if msg then - table.insert(locale(self.locale, msg, ...)) + table.insert(self.description, locale(self.locale, msg, ...)) + return self else local embed = self.parentEmbed(self.locale, "none") embed.embeds[1].description = table.concat(self.description) diff --git a/libs/locale/runtime/en-US.lua b/libs/locale/runtime/en-US.lua index b9b2623..6b9c292 100644 --- a/libs/locale/runtime/en-US.lua +++ b/libs/locale/runtime/en-US.lua @@ -472,6 +472,7 @@ https://discord.gg/%s]], embedWarning = "⚠ Warning", embedError = "❗ Error", newline = "\n", + asIs = "%s", inCategory = "in %s category", diff --git a/libs/storage/channels.lua b/libs/storage/channels.lua index f5671f6..dbfdfd3 100644 --- a/libs/storage/channels.lua +++ b/libs/storage/channels.lua @@ -62,7 +62,7 @@ setmetatable(channels, { if parent then self[channelID] = setmetatable({ id = channelID, - guildID = parent.guild and parent.guild.id or parent.id, + guildID = parent.guild and parent.guild.id or parent.guildID or parent.id, parentType = tonumber(parentType), host = host, parent = parent,