reply method

Future<Interaction> reply({
  1. String? content,
  2. List<EmbedBuilder>? embeds,
  3. ComponentBuilder? components,
  4. List<AttachmentBuilder>? attachments,
  5. bool? tts,
  6. bool? private,
})

Responds to this by an Message

Example :

await interaction.reply(content: 'Hello ${interaction.user.username}');

Implementation

Future<Interaction> reply ({ String? content, List<EmbedBuilder>? embeds, ComponentBuilder? components, List<AttachmentBuilder>? attachments, bool? tts, bool? private }) async {
  dynamic messagePayload = MessageParser(content, embeds, components, attachments, tts).toJson();

  dynamic payload = {
    'type': InteractionCallbackType.channelMessageWithSource.value,
    'data': {
      ...messagePayload['payload'],
      'flags': private != null && private == true ? 1 << 6 : null
    }
  };

  await ioc.use<DiscordApiHttpService>().post(url: "/interactions/$id/$token/callback")
    .files(messagePayload['files'])
    .payload(payload)
    .build();

  return this;
}