dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
651 stars 154 forks source link

NotImplementedError while submitting model #548

Closed GSstarGamer closed 11 months ago

GSstarGamer commented 11 months ago

Summary

NotImplementedError

Reproduction Steps

requires a and action_row to have text_input in a model and put in an answer for text_input, and submit

Code

if ctx.components:
    for comp in ctx.components:
        for child in comp.children:
            if str(child.type) == "ComponentType.button" and child.label == 'Catch me!':
                modelg = await child.click()
                await bot.wait_for("modal")
                model = modelg.modal
                for action in model.components:
                    if str(action.type) == 'ComponentType.action_row':
                        for textInp in action.children:
                            if str(textInp.type) == 'ComponentType.text_input':
                                textInp.answer('answer')
                                print(textInp.to_dict())
                await model.submit()

Expected Results

model to submit and bot (not selfbot) to respond

Actual Results

Traceback (most recent call last): File "C:\Users\giris\AppData\Roaming\Python\Python311\site-packages\discord\client.py", line 507, in _run_event await coro(*args, **kwargs) File "C:\Users\giris\OneDrive\Documents\Codes\testingselfbot\slashcommand.py", line 37, in on_message await model.submit() File "C:\Users\giris\AppData\Roaming\Python\Python311\site-packages\discord\modal.py", line 136, in submit self.to_dict(), ^^^^^^^^^^^^^^ File "C:\Users\giris\AppData\Roaming\Python\Python311\site-packages\discord\modal.py", line 104, in to_dict 'components': [c.to_dict() for c in self.components], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\giris\AppData\Roaming\Python\Python311\site-packages\discord\modal.py", line 104, in 'components': [c.to_dict() for c in self.components], ^^^^^^^^^^^ File "C:\Users\giris\AppData\Roaming\Python\Python311\site-packages\discord\components.py", line 102, in to_dict raise NotImplementedError NotImplementedError

System Information

Checklist

Additional Information

No response

RobbyV2 commented 11 months ago

This is caused by an outdated version on pypi, please install the package from with pip install git+https://github.com/dolfies/discord.py-self.git

GSstarGamer commented 11 months ago

wait its you, ur the one who told me to work on this xd