Skip to content

Commit c55b7b0

Browse files
authored
Separate respond() and followup()
1 parent 025d772 commit c55b7b0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

discord/commands/context.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,24 @@ def response(self) -> InteractionResponse:
134134

135135
@property
136136
def respond(self):
137-
return self.followup.send if self.response.is_done() else self.interaction.response.send_message
137+
if not self.response.is_done():
138+
return self.interaction.response.send_message
139+
else:
140+
raise RuntimeError("Interaction was already issued a response. Try using ApplicationContext.followup() instead.")
141+
142+
@property
143+
def followup(self):
144+
if self.response.is_done():
145+
return self.followup.send
146+
else:
147+
raise RuntimeError("Interaction was not yet issued a response. Try using ApplicationContext.respond() first.")
138148

139149
@property
140150
def defer(self):
141151
return self.interaction.response.defer
142152

143153
@property
144-
def followup(self):
154+
def followup_webhook(self):
145155
return self.interaction.followup
146156

147157
async def delete(self):

0 commit comments

Comments
 (0)