Skip to content

Commit

Permalink
fixed greeting sending in companionless rooms yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
BestMordaEver committed May 23, 2024
1 parent ea97b99 commit a31cb52
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Voice Manager v4.6.6
## Voice Manager v4.7.3

<a href="https://top.gg/bot/601347755046076427">
<img src="https://top.gg/api/widget/status/601347755046076427.svg" alt="Voice Manager" />
Expand Down
5 changes: 2 additions & 3 deletions libs/embeds/greeting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ return embedHandler("greeting", function (room, ephemeral)

if not channelData.parent.greeting then return end

local companion = client:getChannel(channelData.companion)
if not companion then return end
local companion = client:getChannel(channelData.companion) or room

local member = room.guild:getMember(channelData.host)
local uname = member.user.name
local nickname = member.nickname or uname

local rt = {
roomname = room.name,
chatname = companion and companion.name or nil,
chatname = companion.name,
nickname = nickname,
name = uname,
tag = member.user.tag,
Expand Down
4 changes: 2 additions & 2 deletions libs/embeds/roomInfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ return embedHandler("roomInfo", function (room, ephemeral)
liner(room, roomPO, "voice", permission.connect),
liner(room, roomPO, "voice", permission.speak),
liner(room, roomPO, "voice", permission.sendMessages),
companion and companion ~= room and liner(companion, chatPO, "text", permission.readMessages),
companion and companion ~= room and liner(companion, chatPO, "text", permission.sendMessages)
companion and liner(companion, chatPO, "text", permission.readMessages),
companion and liner(companion, chatPO, "text", permission.sendMessages)
}

table.insert(fields, {name = locale.roomInfoCommands, value = availableCommands(room)})
Expand Down
2 changes: 1 addition & 1 deletion libs/events/channelDelete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ return function (channel) -- and make sure there are no traces!
lobbyData:delete()
end
if channelData then
local companion = client:getChannel(channelData.companion)
local companion = client:getChannel(channelData.companion) or channel
if companion then
local companionID = companion.id
if channelData.parent and channelData.parent.companionLog then
Expand Down

0 comments on commit a31cb52

Please sign in to comment.