Refactor GetChannelId out of FindOrJoinChannel
No reason for it to be nested
This commit is contained in:
@@ -13,7 +13,6 @@ function shared.Messenger.Init()
|
||||
---@type table<string, number>
|
||||
local channelIdMap = {}
|
||||
|
||||
local function FindOrJoinChannel(channelName, password)
|
||||
local function GetChannelId(channelName)
|
||||
local channels = { GetChannelList() }
|
||||
for i = 1, #channels, 2 do
|
||||
@@ -25,6 +24,7 @@ function shared.Messenger.Init()
|
||||
end
|
||||
end
|
||||
|
||||
local function FindOrJoinChannel(channelName, password)
|
||||
local channelId = GetChannelId(channelName)
|
||||
if not channelId then
|
||||
print("Channel", tostring(channelName), "not found, joining")
|
||||
|
Reference in New Issue
Block a user