addText method

void addText(
  1. String text
)

Adds text content to the message.

Supports Discord markdown formatting including bold, italic, code blocks, headers, lists, and more.

Example:

builder
  ..addText('# This is a header')
  ..addText('**Bold text** and *italic text*')
  ..addText('`inline code` and ```code block```')
  ..addText(
    '- List item 1\n'
    '- List item 2\n'
    '- List item 3',
  );

See also:

Implementation

void addText(String text) {
  _components.add(TextDisplay(text));
}