Skip to content

Commit 6ab96f6

Browse files
committed
🐛 Fix no return on Template._from_data
1 parent f887d26 commit 6ab96f6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

discord/template.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
from typing import TYPE_CHECKING, Any
2929

30+
from typing_extensions import Self
31+
3032
from .guild import Guild
3133
from .utils import MISSING, Undefined
3234
from .utils.private import bytes_to_base64_data, parse_time
@@ -132,7 +134,7 @@ class Template:
132134
)
133135

134136
@classmethod
135-
async def from_data(cls, state: ConnectionState, data: TemplatePayload) -> None:
137+
async def from_data(cls, state: ConnectionState, data: TemplatePayload) -> Self:
136138
self = cls()
137139
self._state = state
138140

@@ -160,6 +162,7 @@ async def from_data(cls, state: ConnectionState, data: TemplatePayload) -> None:
160162
self.source_guild = guild
161163

162164
self.is_dirty: bool | None = data.get("is_dirty", None)
165+
return self
163166

164167
def __repr__(self) -> str:
165168
return (

0 commit comments

Comments
 (0)