reply method

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

Reply to this message

await message.reply(content: 'Hello world!');

Implementation

Future<PartialMessage?> reply ({ String? content, List<EmbedBuilder>? embeds, ComponentBuilder? components, List<AttachmentBuilder>? attachments, bool? tts }) async {
  MineralClient client = ioc.use<MineralClient>();

  Response response = await client.sendMessage(channel,
    content: content,
    embeds: embeds,
    components: components,
    messageReference: {
      'guild_id': channel.guild.id,
      'channel_id': channel.id,
      'message_id': id,
    },
    attachments: attachments
  );

  if (response.statusCode == 200) {
    Message message = Message.from(channel: channel, payload: jsonDecode(response.body));

    channel.messages.cache.putIfAbsent(message.id, () => message);
    return message;
  }

  return null;
}