Skip to content

[BUG] Guild is not passed to a message when using a Context menu #1536

Open
@mAxYoLo01

Description

@mAxYoLo01

Library Version

latest

Describe the Bug

The guild that a message command is used on is not defined (i.e. ctx.target.guild is None). Most of the time, ctx.guild can be used instead for the user to work with but that means that some of the Message class features do NOT work as intended since the message acts as if it were written in DMs.
For example: #1535 returns users even when used in a guild if the message was not previously cached.

Steps to Reproduce

@interactions.context_menu(name="Test", context_type=interactions.CommandType.MESSAGE)
async def test(ctx: interactions.ContextMenuContext):
    print(ctx.target.guild)
    print(ctx.guild)

Results:

> None
> Guild(...)

Expected Results

Expected:

> Guild(...)
> Guild(...)

Minimal Reproducible Code

No response

Traceback

No response

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.
  • I have attempted to debug this myself, and I believe this issue is with the library

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions