java.lang.Object
java.lang.Record
nl.andrewl.concord_core.msg.types.chat.ChatHistoryRequest
- All Implemented Interfaces:
Message
A message which clients can send to the server to request some messages from
the server's history of all sent messages from a particular source. Every
request must provide the id of the source that messages should be fetched
from, in addition to the type of source (channel, thread, dm).
The query string is a specially-formatted string that allows you to
filter results to only certain messages, using different parameters that
are separated by the ;
character.
All query parameters are of the form param=value
, where
param
is the case-sensitive name of the parameter, and
value
is the value of the parameter.
The following query parameters are supported:
count
- Fetch up to N messages. Minimum of 1, and a server-specific maximum count, usually no higher than 1000.from
- ISO-8601 timestamp indicating the timestamp after which messages should be fetched. Only messages after this point in time are returned.to
- ISO-8601 timestamp indicating the timestamp before which messages should be fetched. Only messages before this point in time are returned.id
- A single message id to fetch. If this parameter is present, all others are ignored, and a list containing the single message is returned, if it could be found, otherwise an empty list.
Responses to this request are sent via ChatHistoryResponse
, where
the list of messages is always sorted by the timestamp.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChatHistoryRequest
(UUID channelId) ChatHistoryRequest
(UUID channelId, String query) Creates an instance of aChatHistoryRequest
record class.ChatHistoryRequest
(UUID channelId, Map<String, String> params) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thechannelId
record component.final boolean
Indicates whether some other object is "equal to" this one.Utility method to extract the query string's values as a key-value map.final int
hashCode()
Returns a hash code value for this object.query()
Returns the value of thequery
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.andrewl.concord_core.msg.Message
byteSize, getTypeSerializer
-
Field Details
-
channelId
The field for thechannelId
record component. -
query
The field for thequery
record component.
-
-
Constructor Details
-
ChatHistoryRequest
-
ChatHistoryRequest
-
ChatHistoryRequest
Creates an instance of aChatHistoryRequest
record class.- Parameters:
channelId
- the value for thechannelId
record componentquery
- the value for thequery
record component
-
-
Method Details
-
getQueryAsMap
Utility method to extract the query string's values as a key-value map.- Returns:
- A map of the query parameters.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
channelId
Returns the value of thechannelId
record component.- Returns:
- the value of the
channelId
record component
-
query
Returns the value of thequery
record component.- Returns:
- the value of the
query
record component
-