Skip to content

Commit 5d62aac

Browse files
committed
fix typing for ApplicationContext.author
1 parent 16e7aff commit 5d62aac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

discord/commands/context.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ def message(self) -> Optional[Message]:
103103
def user(self) -> Optional[Union[Member, User]]:
104104
return self.interaction.user
105105

106+
@cached_property
107+
def author(self) -> Optional[Union[Member, User]]:
108+
return self.user
109+
106110
@property
107111
def voice_client(self):
108112
return self.guild.voice_client
@@ -111,8 +115,6 @@ def voice_client(self):
111115
def response(self) -> InteractionResponse:
112116
return self.interaction.response
113117

114-
author = user
115-
116118
@property
117119
def respond(self):
118120
return self.followup.send if self.response.is_done() else self.interaction.response.send_message

0 commit comments

Comments
 (0)