Closed s3m1s0n1c closed 7 years ago
By specifying ChannelName
a single string, you are restricting the channels you can find to children of the root channel.
For example, if you have a server like:
Root
Child 1
Child 2
Child 2.1
Child 2.2
Child 2.2.1
Child 3
The only value of ChannelName
that would cause b.Client.Channels.Find
to succeed are "Child 1", "Child 2", and "Child 3". You would not be able to find any of the other channels, including the root channel.
What you should be doing instead is create a slice of strings which specify a path to the channel. For example:
ChannelName := []string{"Child 2", "Child 2.2", "Child 2.2.1"}
channel := b.Client.Channels.Find(ChannelName...)
That code would return the deeply nested "Child 2.2.1" channel.
How parse and generate the string slice of channel names is up to you.
Thanks.. Will try and work it out.. I'm only new to golang..
Hey Guys,
Trying to get this function to work but its not working.
I use this function to see what channel we should be in and then move to that channel using the function below which uses channels.find
So this functions uses Channel.Find to get the channels under above the channel we wanna be in but this function below wont work for me.
Any Ideas?
Thanks Sonic