Closed retr0-init closed 2 months ago
When trying to retrieve the user id of the response metadata of a message, it returns user_id is not the valid attribute of the object.
user_id
There is a valid user id attribute in the class already, which is _user_id. I suspect it was just a typo.
_user_id
N/A
@interactions.slash_command( "test1", description="test channel command", scopes=[DEV_GUILD] if DEV_GUILD else None ) @interactions.slash_option( name="integer", description="int", opt_type=interactions.OptionType.STRING, required=True ) async def test_cmd1(self, ctx: interactions.SlashContext, integer: str): """Register as an extension command""" msg: interactions.Message = await ctx.channel.fetch_message(integer) msg_ref: interactions.Message = msg.interaction_metadata if msg_ref: print(msg_ref) await ctx.send(f"replied to {msg_ref.user}") else: await ctx.send("This message does not have a reference")
3.10.x
3.11.x
pre-commit
Pull Request Type
Description
When trying to retrieve the user id of the response metadata of a message, it returns
user_id
is not the valid attribute of the object.Changes
There is a valid user id attribute in the class already, which is
_user_id
. I suspect it was just a typo.Related Issues
N/A
Test Scenarios
Python Compatibility
3.10.x
3.11.x
Checklist
pre-commit
code linter over all edited files