respond method
- MessageBuilder builder, {
- bool? isEphemeral,
Send a response to this interaction.
Implementation
Future<void> respond(MessageBuilder builder, {bool? isEphemeral}) async {
if (_didRespond) {
throw AlreadyRespondedError(this);
}
if (!_didAcknowledge) {
_didAcknowledge = true;
_didRespond = true;
_wasEphemeral = isEphemeral;
await manager.createResponse(id, token, InteractionResponseBuilder.channelMessage(builder, isEphemeral: isEphemeral));
} else {
assert(isEphemeral == _wasEphemeral || isEphemeral == null, 'Cannot change the value of isEphemeral between acknowledge and respond');
_didRespond = true;
await manager.createFollowup(token, builder);
}
}