ask method

bool ask(
  1. String text
)

Asks a question (up to 3 every 30 seconds, maxQuestionChars long).

Implementation

bool ask(String text) {
  final now = DateTime.now().millisecondsSinceEpoch;
  _asked.removeWhere((t) => now - t >= 30000);
  if (_asked.length >= 3 || text.trim().isEmpty) return false;
  _asked.add(now);
  _sendQa({'t': 'ask', 'id': newQuestionId(), 'text': text.length > maxQuestionChars ? text.substring(0, maxQuestionChars) : text});
  return true;
}