Class Message
Implements
Namespace: GroupMeClientApi.Models
Assembly: GroupMeClientApi.dll
Syntax
public class Message : object, IAvatarSource
Constructors
| Improve this Doc View SourceMessage()
Initializes a new instance of the Message class.
Declaration
public Message()
Properties
| Improve this Doc View SourceAttachments
Gets a list of Attachments attached to this Message.
Declaration
public List<Attachment> Attachments { get; }
Property Value
| Type | Description |
|---|---|
| List<Attachment> |
AvatarUrl
Gets the Url of the avatar or profile picture for the Member who sent the message.
Declaration
public string AvatarUrl { get; }
Property Value
| Type | Description |
|---|---|
| String |
Chat
Gets the Chat this message belongs to. If this message is a Group Message, this field will be null.
Declaration
public Chat Chat { get; }
Property Value
| Type | Description |
|---|---|
| Chat |
ChatId
Gets the conversation identifier for a Chat where this message was sent. This property is ONLY used with with DirectMessageCreateNotification. If this Message represents a Group Message, this field will be null. This property should be the same as ConversationId.
Declaration
public string ChatId { get; }
Property Value
| Type | Description |
|---|---|
| String |
ConversationId
Gets the conversation identifier for a Chat where this message was sent. If this Message represents a Group Message, this field will be null.
Declaration
public string ConversationId { get; }
Property Value
| Type | Description |
|---|---|
| String |
CreatedAtTime
Gets the time when the message was created.
Declaration
public DateTime CreatedAtTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
CreatedAtUnixTime
Gets the Unix Timestamp when the message was created.
Declaration
public int CreatedAtUnixTime { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
FavoritedBy
Gets a list of identifiers for Member who 'liked' this message.
Declaration
public IList<string> FavoritedBy { get; }
Property Value
| Type | Description |
|---|---|
| IList<String> |
Group
Gets the Group this messages belongs to. If this message is a Direct message, this field will be null.
Declaration
public Group Group { get; }
Property Value
| Type | Description |
|---|---|
| Group |
GroupId
Gets the identifier for a Group where this message was sent. If this Message represents a Direct Message, this field will be null.
Declaration
public string GroupId { get; }
Property Value
| Type | Description |
|---|---|
| String |
Id
Gets the message identifier.
Declaration
public string Id { get; }
Property Value
| Type | Description |
|---|---|
| String |
ImageDownloader
Gets the ImageDownloader that can be used to download attachments.
Declaration
public ImageDownloader ImageDownloader { get; }
Property Value
| Type | Description |
|---|---|
| ImageDownloader |
Name
Gets the name of the Member who sent the message.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| String |
Platform
Gets the platform this message was sent from.
Declaration
public string Platform { get; }
Property Value
| Type | Description |
|---|---|
| String |
RecipientId
Gets the identifier for the Member a Direct Message was sent to.
Declaration
public string RecipientId { get; }
Property Value
| Type | Description |
|---|---|
| String |
SenderType
Gets the type of sender who sent this message.
Declaration
public string SenderType { get; }
Property Value
| Type | Description |
|---|---|
| String |
SourceGuid
Gets the GUID assigned by the sender.
Declaration
public string SourceGuid { get; }
Property Value
| Type | Description |
|---|---|
| String |
Text
Gets the message contents.
Declaration
public string Text { get; }
Property Value
| Type | Description |
|---|---|
| String |
UserId
Gets the identifier for a Member who sent a Group Message.
Declaration
public string UserId { get; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
| Improve this Doc View SourceAssociateWithChat(Chat)
Associates this Message with a Chat. This will enable API operations on a message that was not retreived directly from a GroupMeClient. Unassociated messages may be loaded or deserialized from a database or other persistant storage.
Declaration
public void AssociateWithChat(Chat chat)
Parameters
| Type | Name | Description |
|---|---|---|
| Chat | chat | The chat to associate this message with. |
AssociateWithGroup(Group)
Associates this Message with a Group. This will enable API operations on a message that was not retreived directly from a GroupMeClient. Unassociated messages may be loaded or deserialized from a database or other persistant storage.
Declaration
public void AssociateWithGroup(Group group)
Parameters
| Type | Name | Description |
|---|---|---|
| Group | group | The group to associate this message with. |
CreateMessage(String, IEnumerable<Attachment>, String, String)
Declaration
public static Message CreateMessage(string body, IEnumerable<Attachment> attachments = null, string guidPrefix = "", string guid = "")
Parameters
| Type | Name | Description |
|---|---|---|
| String | body | The message contents. |
| IEnumerable<Attachment> | attachments | A list of attachments to be included with the message. |
| String | guidPrefix | An optional prefix to add to the message's GUID. |
| String | guid | The GUID to use for the message. If null or blank, a random GUID will be generated. Any applicable prefixes will be included. |
Returns
| Type | Description |
|---|---|
| Message | True if successful, false otherwise. |
LikeMessage()
Likes this Message.
Declaration
public Task<bool> LikeMessage()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | True if successful. |
UnlikeMessage()
Unlikes this Message.
Declaration
public Task<bool> UnlikeMessage()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | True if successful. |
Explicit Interface Implementations
| Improve this Doc View SourceIAvatarSource.ImageOrAvatarUrl
Gets the avatar URL for this IAvatarSource.
Declaration
string IAvatarSource.ImageOrAvatarUrl { get; }
Returns
| Type | Description |
|---|---|
| String |
IAvatarSource.IsRoundedAvatar
Gets a value indicating whether the avatar image should be rounded for this IAvatarSource.
Declaration
bool IAvatarSource.IsRoundedAvatar { get; }
Returns
| Type | Description |
|---|---|
| Boolean |