-
Notifications
You must be signed in to change notification settings - Fork 187
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
Cannot edit an InteractionMessage #1168
Comments
apsw171118
added
the
t: unconfirmed bug
Type: bug - needs testing on if this is an issue
label
Feb 27, 2024
Can you make the minimal reproducible code actually minimal? It's hard to understand with multiple nested conditions. |
@nextcord.slash_command(name="bug-test")
async def bugtest(self, interaction):
msg = await interaction.response.send_message("abc1")
msg = await msg.edit("abc2")
msg = await msg.edit("abc3") Ignoring exception in command <nextcord.application_command.SlashApplicationCommand object at 0x00000244D4B5D3D0>:
Traceback (most recent call last):
File "C:\Users\ng_jo\AppData\Local\Programs\Python\Python312\Lib\site-packages\nextcord\application_command.py", line 918, in invoke_callback_with_hooks
await self(interaction, *args, **kwargs)
File "C:\Users\ng_jo\OneDrive\Backup\Desktop\joshuang\coding\.GITHUBCLONE\Testing-Bot\cogs\dev\__init__.py", line 123, in bugtest
msg = await msg.edit("abc3")
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ng_jo\AppData\Local\Programs\Python\Python312\Lib\site-packages\nextcord\interactions.py", line 1180, in edit
message = await self._state._interaction.edit_original_message(
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConnectionState' object has no attribute '_interaction'
The above exception was the direct cause of the following exception:
nextcord.errors.ApplicationInvokeError: Command raised an exception: AttributeError: 'ConnectionState' object has no attribute '_interaction' sorry for the multiple edits, still getting used to the github markdown 😅 |
Can reproduce. As a temporary fix you can not collect the message until the end: @nextcord.slash_command(name="bug-test")
async def bugtest(self, interaction):
msg = await interaction.response.send_message("abc1")
await msg.edit("abc2")
msg = await msg.edit("abc3")
print(msg.content) # abc3 |
teaishealthy
added
t: bug
Type: bug - something isn't working
p: medium
Priority: medium - should be worked on in the near future
and removed
t: unconfirmed bug
Type: bug - needs testing on if this is an issue
labels
Apr 19, 2024
teaishealthy
added a commit
to teaishealthy/disnake
that referenced
this issue
Apr 19, 2024
2 tasks
teaishealthy
added
the
s: awaiting review
Status: the issue or PR is awaiting reviews
label
Apr 19, 2024
2 tasks
EmreTech
removed
the
s: awaiting review
Status: the issue or PR is awaiting reviews
label
May 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Cannot edit a message using the function .edit
Reproduction Steps
"Dropping existing records..\nApplying new records..." basically returns this:
Ignoring exception in command <nextcord.application_command.SlashApplicationSubcommand object at 0x0000022FF5DE32F0>:
Traceback (most recent call last):
File "C:\Users\ng_jo\AppData\Local\Programs\Python\Python312\Lib\site-packages\nextcord\application_command.py", line 918, in invoke_callback_with_hooks
await self(interaction, *args, **kwargs)
File "C:\Users\ng_jo\OneDrive\Backup\Desktop\joshuang\coding.GITHUBCLONE\Testing-Bot\cogs\tickets_init_.py", line 319, in register_config
await msg.edit(
File "C:\Users\ng_jo\AppData\Local\Programs\Python\Python312\Lib\site-packages\nextcord\interactions.py", line 1180, in edit
message = await self._state._interaction.edit_original_message(
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConnectionState' object has no attribute '_interaction'
The above exception was the direct cause of the following exception:
nextcord.errors.ApplicationInvokeError: Command raised an exception: AttributeError: 'ConnectionState' object has no attribute '_interaction'
Minimal Reproducible Code
Expected Results
edit the message
Actual Results
threw me an error idk what it means
Intents
nextcord.Intents.all()
System Information
nextcord-ext-menus 1.5.7
i've got discord.py i don't think it would affect it tho...
Checklist
Additional Context
support thread here: https://ptb.discord.com/channels/881118111967883295/1212126972784807987
The text was updated successfully, but these errors were encountered: