Summary
Modal.remove_item() crashes with AttributeError: 'Modal' object has no attribute '_Modal__weights'
Reproduction Steps
- Create a
discord.ui.Modal, add two InputText children (e.g.)
- Call
modal.remove_item(modal.children[0])
- Every call crashes with
AttributeError: 'Modal' object has no attribute '_Modal__weights'
Minimal Reproducible Code
async def main():
modal = discord.ui.Modal(title="Test")
modal.add_item(discord.ui.InputText(label="A"))
modal.add_item(discord.ui.InputText(label="B"))
modal.remove_item(modal.children[0])
Expected Results
Removes the item from the modal, returning self (same as BaseModal.remove_item does for _children).
Actual Results
AttributeError: 'Modal' object has no attribute '_Modal__weights'
Intents
All
System Information
- Python v3.13.6
- py-cord master
Checklist
Additional Context
This issue wasn't found by me, as I am not a discord bot developer, I just delegate.
However, I believe this bug is critical.
Summary
Modal.remove_item()crashes withAttributeError: 'Modal' object has no attribute '_Modal__weights'Reproduction Steps
discord.ui.Modal, add twoInputTextchildren (e.g.)modal.remove_item(modal.children[0])AttributeError: 'Modal' object has no attribute '_Modal__weights'Minimal Reproducible Code
Expected Results
Removes the item from the modal, returning self (same as
BaseModal.remove_itemdoes for_children).Actual Results
Intents
All
System Information
Checklist
Additional Context
This issue wasn't found by me, as I am not a discord bot developer, I just delegate.
However, I believe this bug is critical.