layeh / gumble

gumble is a Mumble client implementation in Go (golang)
https://pkg.go.dev/mod/layeh.com/gumble
Mozilla Public License 2.0
173 stars 53 forks source link

how to join a channel with gumble lib #40

Closed Tux04 closed 7 years ago

Tux04 commented 7 years ago

41/5000 how does a user change the channel in gumble ? 63/5000 with which function a user changes to another channel?

ghost commented 7 years ago
channel := client.Channels.Find("Root Channel", "sub channel", ...)
if channel != nil {
    client.Self.Move(channel)
}
Tux04 commented 7 years ago

Thank you for your help, you have helped me a lot !!!

regards

Dirk

s3m1s0n1c commented 6 years ago

Is there any reason why this doesn't go to root/sub/sub channels

Say i wanna go to Channel B I use -channel "Channel B" and it says Unable to find Channel B

Root -Channel 1 --Channel A --Channel B -Channel 2

channel := b.Client.Channels.Find(ChannelName)
        if channel != nil {
        fmt.Printf("Move Channel Name: %s\n", channel)
                b.Client.Self.Move(channel)
        } else {
                fmt.Printf("Unable to find channel: %s\n", ChannelName)
        }
ghost commented 6 years ago

@s3m1s0n1c Mumble channels have a tree structure, so you need to specify the complete "path" to the channel from the root.

If you just want to join any channel with that name, you could try something like:

for _, channel := range b.Client.Channels {
    if channel.Name == ChannelName {
        b.Client.Self.Move(channel)
        break
    }
}
s3m1s0n1c commented 6 years ago

Thanks Works a treat 👍