Giter Site home page Giter Site logo

Comments (3)

ooliver1 avatar ooliver1 commented on July 20, 2024

Can you make the minimal reproducible code actually minimal? It's hard to understand with multiple nested conditions.

from nextcord.

apsw171118 avatar apsw171118 commented on July 20, 2024
@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")

At third edit:
image

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' 

image

sorry for the multiple edits, still getting used to the github markdown 😅

from nextcord.

teaishealthy avatar teaishealthy commented on July 20, 2024

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

from nextcord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.