Yucked / Victoria

🌋 - Lavalink wrapper for Discord.NET. Provides more options and performs better than all .NET Lavalink libraries combined.
https://github.com/Yucked/Victoria/wiki
193 stars 48 forks source link

[ BUG ] GetPlayer&TryGetPlayer fails with KeyNotFoundException #139

Closed asteria121 closed 1 year ago

asteria121 commented 1 year ago


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.

asteria121 commented 1 year ago