mahtoid / DiscordChatExporterPy

A simple Discord chat exporter for Python Discord bots.
GNU General Public License v3.0
210 stars 75 forks source link

Pycord deprecated message.interaction #106

Closed tibue99 closed 7 months ago

tibue99 commented 7 months ago

DiscordChatExporterPy Version

2.7.1

Discord Version

Pycord 2.5.1.dev67+g19a9751d

Bug Description

Pycord deprecated message.interaction in this PR. This causes build_interaction to break. A temporary workaround would look like this:

async def build_interaction(self):
    if not self.message.interaction:
        try:
            self.message.interaction = ""
        except AttributeError:
            self.message._interaction = ""
        return

Bug Traceback

Traceback (most recent call last): File "C:\Users\Timo\Desktop\keks-bot.venv\Lib\site-packages\chat_exporter\construct\transcript.py", line 171, in export return await super().build_transcript() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Timo\Desktop\keks-bot.venv\Lib\site-packages\chat_exporter\construct\transcript.py", line 56, in build_transcript message_html, meta_data = await gather_messages( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Timo\Desktop\keks-bot.venv\Lib\site-packages\chat_exporter\construct\message.py", line 455, in gather_messages content_html, meta_data = await MessageConstruct( ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Timo\Desktop\keks-bot.venv\Lib\site-packages\chat_exporter\construct\message.py", line 92, in construct_message await self.build_message() File "C:\Users\Timo\Desktop\keks-bot.venv\Lib\site-packages\chat_exporter\construct\message.py", line 98, in build_message await self.build_interaction() File "C:\Users\Timo\Desktop\keks-bot.venv\Lib\site-packages\chat_exporter\construct\message.py", line 208, in build_interaction self.message.interaction = "" ^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: property 'interaction' of 'Message' object has no setter

Additional Information

No response

mahtoid commented 7 months ago

...why

plun1331 commented 7 months ago

That was an unintended effect of making interaction a property so I could add a deprecation warning- that has been fixed