From fc17274413fea5c415c19c0450b90eddf2369608 Mon Sep 17 00:00:00 2001 From: Paillat Date: Fri, 1 Aug 2025 15:58:39 +0200 Subject: [PATCH 1/2] :bug: Fix missing self. attribution in File --- discord/ui/file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/ui/file.py b/discord/ui/file.py index e502b46588..052e0ea9ab 100644 --- a/discord/ui/file.py +++ b/discord/ui/file.py @@ -45,12 +45,12 @@ class File(Item[V]): def __init__(self, url: str, *, spoiler: bool = False, id: int | None = None): super().__init__() - file = UnfurledMediaItem(url) + self.file = UnfurledMediaItem(url) self._underlying = FileComponent._raw_construct( type=ComponentType.file, id=id, - file=file, + file=self.file, spoiler=spoiler, ) From 0bd1e8e7064224795866fdc8cb14dd7b0b4108c7 Mon Sep 17 00:00:00 2001 From: Paillat Date: Fri, 1 Aug 2025 16:00:14 +0200 Subject: [PATCH 2/2] :memo: CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97c6a99cbe..9a408f10ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -121,6 +121,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2800](https://github.com/Pycord-Development/pycord/pull/2800)) - Fixed `VoiceClient.connect` failing to do initial connection. ([#2812](https://github.com/Pycord-Development/pycord/pull/2812)) +- Fixed `AttributeError` when printing a File component's `__repr__`. + ([#2843](https://github.com/Pycord-Development/pycord/pull/2843)) ### Changed