Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Null reference error in context UserInstall #2969

Open
3 tasks done
ForceFK opened this issue Jul 22, 2024 · 0 comments
Open
3 tasks done

[Bug]: Null reference error in context UserInstall #2969

ForceFK opened this issue Jul 22, 2024 · 0 comments
Assignees
Labels

Comments

@ForceFK
Copy link
Contributor

ForceFK commented Jul 22, 2024

Check The Docs

  • I double checked the docs and couldn't find any useful information.

Verify Issue Source

  • I verified the issue was caused by Discord.Net.

Check your intents

  • I double checked that I have the required intents.

Description

When a message-type interaction is used in the context UserInstall (the bot is not in group but installed on the user's account) and the target message contains roles and/or is a reply to another message, the error occurs.

The error points to the following files: Discord.Net.WebSocket\Entities\Messages\SocketMessage.cs (line 278 Channel is null) and Discord.Net.WebSocket\Entities\Messages\SocketUserMessage.cs (line 93 guild is null), but there may be more files...

Version

3.15.3

Working Version

No response

Logs

System.NullReferenceException: Object reference not set to an instance of an object.
   at Discord.WebSocket.SocketUserMessage.<>c__DisplayClass48_0.<Update>b__0(UInt64 x)
   at System.Linq.Enumerable.SelectArrayIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
   at System.Linq.Enumerable.SelectArrayIterator`2.ToArray()
   at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
   at Discord.WebSocket.SocketUserMessage.Update(ClientState state, Message model)
   at Discord.WebSocket.SocketUserMessage.Create(DiscordSocketClient discord, ClientState state, SocketUser author, ISocketMessageChannel channel, Message model)
   at Discord.WebSocket.SocketMessage.Create(DiscordSocketClient discord, ClientState state, SocketUser author, ISocketMessageChannel channel, Message model)
   at Discord.WebSocket.SocketResolvableData`1..ctor(DiscordSocketClient discord, Nullable`1 guildId, T model)
   at Discord.WebSocket.SocketCommandBaseData`1..ctor(DiscordSocketClient client, ApplicationCommandInteractionData model, Nullable`1 guildId)
   at Discord.WebSocket.SocketCommandBaseData..ctor(DiscordSocketClient client, ApplicationCommandInteractionData model, Nullable`1 guildId)
   at Discord.WebSocket.SocketCommandBaseData`1.Create(DiscordSocketClient client, ApplicationCommandInteractionData model, UInt64 id, Nullable`1 guildId)
   at Discord.WebSocket.SocketCommandBase..ctor(DiscordSocketClient client, Interaction model, ISocketMessageChannel channel, SocketUser user)
   at Discord.WebSocket.SocketMessageCommand..ctor(DiscordSocketClient client, Interaction model, ISocketMessageChannel channel, SocketUser user)
   at Discord.WebSocket.SocketMessageCommand.Create(DiscordSocketClient client, Interaction model, ISocketMessageChannel channel, SocketUser user)
   at Discord.WebSocket.SocketInteraction.Create(DiscordSocketClient client, Interaction model, ISocketMessageChannel channel, SocketUser user)
   at Discord.WebSocket.DiscordSocketClient.ProcessMessageAsync(GatewayOpCode opCode, Nullable`1 seq, String type, Object payload)

Sample

No response

Packages

Discord.Net - 3.15.3

Environment

  • OS: Windows 10 x64
  • SDK: .NET 8
@ForceFK ForceFK added the bug label Jul 22, 2024
@Misha-133 Misha-133 self-assigned this Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants