Skip to content

Commit 0102b7d

Browse files
authored
fix: 🐛 Fix missing self. attribution in File component (#2843)
* 🐛 Fix missing self. attribution in File * 📝 CHANGELOG.md
1 parent 84a68e5 commit 0102b7d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ These changes are available on the `master` branch, but have not yet been releas
121121
([#2800](https://github.com/Pycord-Development/pycord/pull/2800))
122122
- Fixed `VoiceClient.connect` failing to do initial connection.
123123
([#2812](https://github.com/Pycord-Development/pycord/pull/2812))
124+
- Fixed `AttributeError` when printing a File component's `__repr__`.
125+
([#2843](https://github.com/Pycord-Development/pycord/pull/2843))
124126

125127
### Changed
126128

discord/ui/file.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ class File(Item[V]):
4545
def __init__(self, url: str, *, spoiler: bool = False, id: int | None = None):
4646
super().__init__()
4747

48-
file = UnfurledMediaItem(url)
48+
self.file = UnfurledMediaItem(url)
4949

5050
self._underlying = FileComponent._raw_construct(
5151
type=ComponentType.file,
5252
id=id,
53-
file=file,
53+
file=self.file,
5454
spoiler=spoiler,
5555
)
5656

0 commit comments

Comments
 (0)