reply method
Future<Interaction>
reply({
- String? content,
- List<
EmbedBuilder> ? embeds, - ComponentBuilder? components,
- List<
AttachmentBuilder> ? attachments, - bool? tts,
- 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;
}