Yucked/Victoria

[ BUG ] GetPlayer&TryGetPlayer fails with KeyNotFoundException

Closed this issue · 1 comments


Describe the bug/issue.

GetPlayer & TryGetPlayer fails and throw exception like stacktrace below.

I wrote code with DiscordShardedClient instead of DiscordSocketClient. I also add _lavaNode.ConnectAsync() on ShardReady event. I called GetPlayer with "_lavaNode.GetPlayer(Context.Guild);".
Is there any problem with my code or need more information about my code?

Stacktrace / Screenshots

1
Dependency Injection code

Exception thrown
System.Collections.Generic.KeyNotFoundException: The given key '936820198726565949' was not present in the dictionary.
at System.Collections.Concurrent.ConcurrentDictionary`2.ThrowKeyNotFoundException(TKey key)
at IrisBot.Modules.CommandModule.PlayMusic(String query) in D:\Develop\IrisBot\IrisBot\Modules\CommandModule.cs:line 0
at Discord.Interactions.Builders.ModuleClassBuilder.<>c__DisplayClass11_0.<g__ExecuteCallback|1>d.MoveNext()

936820198726565949 is my guild id. I test my slashcommand on this guild.

  • Victoria 5.2.5, Discord.NET 3.9.0