#Fetching a newly created Voice Channel from a SocketClient will always return null

1 messages · Page 1 of 1 (latest)

modern axle
#

I'm creating voice channels and want to retrieve the object as a SocketVoiceChannel after creation, so I can check for users which are connected.
The check happens every minute and if the check detects no users twice, the channel is deleted again.

Sadly, the CreateVoiceChannel task returns the channel as a Rest VoiceChannel and not as a SocketVoiceChannel, even when using a SocketGuild.

I then try to fetch the channel using the socketGuild.GetVoiceChannel() call, which returns null every time.
I feel this is because the channels are not in the current guilds cache.
Do you have any pointers on how to refresh the cache, or download the channel info directly?

This is in a SocketModal interaction, so I only have the Guild Id.
client.GetGuild() returns the same cached object every time, so that also doesn't work for me.

Thanks! 🙂

#

client.GetChannelAsync() returns a restchannel in this case, which is not what I need.
A ConnectedUsers property is only available on the SocketChannel

tawny grail
#

can you just retrieve the channel after that 1 minute timer elapses?

#

if you're not blocking the incoming gateway events, it'll be available in the cache at that point

modern axle
#

Thanks!

tawny grail
#

np

quaint crypt
tawny grail
quaint crypt
idle onyx
spare bough