Skip to content

InteractionContext.Guild always null #2012

@erraineon

Description

@erraineon

The constructor is defined as...

public InteractionContext(IDiscordClient client, IDiscordInteraction interaction, IUser user, IMessageChannel channel = null)
{
    Client = client;
    Interaction = interaction;
    Channel = channel;
    Guild = (interaction as IGuildUser)?.Guild;
    User = user;
    Interaction = interaction;
}

No implementations of IDiscordInteraction also inherit IGuildUser, so Guild is always coalesced to null.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions