Class Chat
Chat represents a GroupMe Direct Message (or Chat) with another user.
Namespace: GroupMeClientApi.Models
Assembly: GroupMeClientApi.dll
Syntax
public class Chat : object, IMessageContainer, IAvatarSource
Constructors
| Improve this Doc View SourceChat()
Initializes a new instance of the Chat class.
Declaration
public Chat()
Chat(String)
Initializes a new instance of the Chat class.
Declaration
public Chat(string conversationId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | conversationId | The conversation ID for this chat. |
Properties
| Improve this Doc View SourceClient
Gets the GroupMeClient that manages this Chat.
Declaration
public GroupMeClient Client { get; }
Property Value
| Type | Description |
|---|---|
| GroupMeClient |
ConversationId
Gets the conversation ID for this chat. The conversation ID identifies both users in the Chat, and matches ConversationId.
Declaration
public string ConversationId { get; }
Property Value
| Type | Description |
|---|---|
| String |
CreatedAtTime
Gets the Date and Time when this chat was created.
Declaration
public DateTime CreatedAtTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
CreatedAtUnixTime
Gets the Unix Timestamp for when this chat was created.
Declaration
public int CreatedAtUnixTime { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Id
Gets the Identifier of this Chat. See OtherUser for more information.
Declaration
public string Id { get; }
Property Value
| Type | Description |
|---|---|
| String |
ImageOrAvatarUrl
Gets the avatar URL for this IAvatarSource.
Declaration
public string ImageOrAvatarUrl { get; }
Property Value
| Type | Description |
|---|---|
| String |
IsRoundedAvatar
Gets a value indicating whether the avatar image should be rounded for this IAvatarSource.
Declaration
public bool IsRoundedAvatar { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
LatestMessage
Gets a copy of the latest message for preview purposes. Note that API Operations, like LikeMessage() cannot be performed. See Messages list instead for full message objects.
Declaration
public Message LatestMessage { get; }
Property Value
| Type | Description |
|---|---|
| Message |
Messages
Declaration
public List<Message> Messages { get; }
Property Value
| Type | Description |
|---|---|
| List<Message> |
Name
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| String |
OtherUser
Gets the Member that this chat is being held with.
Declaration
public virtual Member OtherUser { get; }
Property Value
| Type | Description |
|---|---|
| Member |
ReadReceipt
Gets the latest Read Receipt for this collection.
Declaration
public ReadReceipt ReadReceipt { get; }
Property Value
| Type | Description |
|---|---|
| ReadReceipt |
TotalMessageCount
Gets a copy of the latest message for preview purposes. Note that API Operations, like LikeMessage() cannot be performed. See Messages list instead for full message objects.
Declaration
public int TotalMessageCount { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
UpdatedAtTime
Gets the Date and Time when this chat was last updated.
Declaration
public DateTime UpdatedAtTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
UpdatedAtUnixTime
Gets the Unix Timestamp for when this chat was last updated.
Declaration
public int UpdatedAtUnixTime { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
| Improve this Doc View SourceAssociateWithClient(GroupMeClient)
Associates this Chat with a GroupMe Client to perform API operations. Chats that are created from sources other than a GroupMeClient, such as from deserialization, are unassociated and not fully functional.
Declaration
public void AssociateWithClient(GroupMeClient client)
Parameters
| Type | Name | Description |
|---|---|---|
| GroupMeClient | client | The GroupMe Client to associate this Chat with. |
GetMaxMessagesAsync(MessageRetreiveMode, String)
Returns a set of messages from a this container in the largest possible block-size.
Declaration
public Task<ICollection<Message>> GetMaxMessagesAsync(MessageRetreiveMode mode = MessageRetreiveMode.None, string messageId = "")
Parameters
| Type | Name | Description |
|---|---|---|
| MessageRetreiveMode | mode | The method that should be used to determine the set of messages returned. |
| String | messageId | The Message Id that will be used by the sorting mode set in |
Returns
| Type | Description |
|---|---|
| Task<ICollection<Message>> | A list of Message. |
GetMessagesAsync(MessageRetreiveMode, String)
Returns a set of messages from a this Direct Message / Chat.
Declaration
public Task<ICollection<Message>> GetMessagesAsync(MessageRetreiveMode mode = MessageRetreiveMode.None, string messageId = "")
Parameters
| Type | Name | Description |
|---|---|---|
| MessageRetreiveMode | mode | The method that should be used to determine the set of messages returned. |
| String | messageId | The Message Id that will be used by the sorting mode set in |
Returns
| Type | Description |
|---|---|
| Task<ICollection<Message>> | A list of Message. |
SendMessage(Message)
Sends a message to this Chat.
Declaration
public Task<bool> SendMessage(Message message)
Parameters
| Type | Name | Description |
|---|---|---|
| Message | message | The message to send. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
SendReadReceipt(Message)
Declaration
public Task<bool> SendReadReceipt(Message message)
Parameters
| Type | Name | Description |
|---|---|---|
| Message | message | The message mark as 'read'. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
WhoAmI()
Returns the authenticated user.
Declaration
public Member WhoAmI()
Returns
| Type | Description |
|---|---|
| Member | A Member. |