Reply bool `json:"reply,omitempty"`
}
-// Turn tells if the batch starts a turn: a private batch with a message of
-// another person, or a group batch with a message of another person that
-// mentions the user or replies to a message of the user.
-func (b WhatsAppBatch) Turn() bool {
- return slices.ContainsFunc(b.Messages, func(message WhatsAppMessage) bool {
- return !message.Mine && (!b.Chat.Group || message.Mention || message.Reply)
- })
-}
-
// Text returns the text of the batch for the log, with the times in location.
// The first line starts with [WhatsApp] and names the chat, its ID, and the day
// of the first message. Each message has a line with its time and its sender,
return strings.Join(lines, "\n")
}
+
+// Turn tells if the batch starts a turn: a private batch with a message of
+// another person, or a group batch with a message of another person that
+// mentions the user or replies to a message of the user.
+func (b WhatsAppBatch) Turn() bool {
+ return slices.ContainsFunc(b.Messages, func(message WhatsAppMessage) bool {
+ return !message.Mine && (!b.Chat.Group || message.Mention || message.Reply)
+ })
+}