Class Group
Represents a GroupMe Group Chat.
Namespace: GroupMeClientApi.Models
Assembly: GroupMeClientApi.dll
Syntax
public class Group : object, IMessageContainer, IAvatarSource
Constructors
| Improve this Doc View SourceGroup()
Initializes a new instance of the Group class.
Declaration
public Group()
Properties
| Improve this Doc View SourceClient
Gets the GroupMeClient that manages this Group.
Declaration
public GroupMeClient Client { get; }
Property Value
| Type | Description |
|---|---|
| GroupMeClient |
CreatedAtTime
Gets the time when the group was created.
Declaration
public DateTime CreatedAtTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
CreatedAtUnixTime
Gets the Unix Timestamp when the group was created.
Declaration
public int CreatedAtUnixTime { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Description
Gets the group description text.
Declaration
public string Description { get; }
Property Value
| Type | Description |
|---|---|
| String |
Id
Gets the group identifier.
Declaration
public string Id { get; }
Property Value
| Type | Description |
|---|---|
| String |
ImageUrl
Gets the Url for the Group avatar or image.
Declaration
public string ImageUrl { get; }
Property Value
| Type | Description |
|---|---|
| String |
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. This is the same data as MsgPreview, packaged in a Message object.
Declaration
public Message LatestMessage { get; }
Property Value
| Type | Description |
|---|---|
| Message |
MaxMembers
Gets the maximum number of members who can be in this group.
Declaration
public int MaxMembers { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Members
Gets a list of Members in the group.
Declaration
public virtual ICollection<Member> Members { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<Member> |
Messages
Declaration
public virtual List<Message> Messages { get; }
Property Value
| Type | Description |
|---|---|
| List<Message> |
MsgPreview
Gets a preview of the messages in this group.
Declaration
public Group.MessagesPreview MsgPreview { get; }
Property Value
| Type | Description |
|---|---|
| Group.MessagesPreview |
MutedUntilTime
Gets the time when the group will be unmuted. If the group is not muted, this will return Unix epoch.
Declaration
public DateTime MutedUntilTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Remarks
GroupMe returns 253402300800 for an infinite mute, which is out-of-range for Unix timestamps. Hence the -1 workaround.
MutedUntilUnixTime
Gets a value indicating the time when the group will be unmuted, in Unix format.
Declaration
public long? MutedUntilUnixTime { get; }
Property Value
| Type | Description |
|---|---|
| Nullable<Int64> |
Name
Gets the group name.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| String |
OfficeMode
Gets a value indicating whether the group is in office mode.
Declaration
public bool OfficeMode { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
PhoneNumber
Gets the phone number that can be used to interact with this group over SMS.
Declaration
public string PhoneNumber { get; }
Property Value
| Type | Description |
|---|---|
| String |
ReadReceipt
Gets the latest Read Receipt for this collection.
Declaration
public ReadReceipt ReadReceipt { get; }
Property Value
| Type | Description |
|---|---|
| ReadReceipt |
ShareUrl
Gets a Url to share the group.
Declaration
public string ShareUrl { get; }
Property Value
| Type | Description |
|---|---|
| String |
TotalMessageCount
Gets the total number of messages within this IMessageContainer.
Declaration
public int TotalMessageCount { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Type
Gets the group type.
Declaration
public string Type { get; }
Property Value
| Type | Description |
|---|---|
| String |
UpdatedAtTime
Gets the time when the group was last updated.
Declaration
public DateTime UpdatedAtTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime |
UpdatedAtUnixTime
Gets the Unix Timestamp when the group was last updated.
Declaration
public int UpdatedAtUnixTime { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
| Improve this Doc View SourceAssociateWithClient(GroupMeClient)
Associates this Group with a GroupMe Client to perform API operations. Groups 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 Group 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 Group 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. |
GetMessagesAsync(Int32, MessageRetreiveMode, String)
Returns a set of messages from a this Group Chat.
Declaration
public Task<ICollection<Message>> GetMessagesAsync(int limit, MessageRetreiveMode mode, string messageId)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | limit | Number of messages that should be returned. GroupMe allows a range of 20 to 100 messages at a time. |
| 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. |
MuteGroup(Nullable<Int32>)
Mutes this Group.
Declaration
public Task<bool> MuteGroup(int? durationMinutes)
Parameters
| Type | Name | Description |
|---|---|---|
| Nullable<Int32> | durationMinutes | The duration the group should be muted for, expressed in minutes. To mute the group indefinitely, specify a duration of null. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
SendMessage(Message)
Sends a new message to this Group.
Declaration
public Task<bool> SendMessage(Message message)
Parameters
| Type | Name | Description |
|---|---|---|
| Message | message | The message to send. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
UnMuteGroup()
Unmutes this Group.
Declaration
public Task<bool> UnMuteGroup()
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
UpdateGroupAvatar(Byte[])
Updates the avatar for the this Group.
Declaration
public Task<bool> UpdateGroupAvatar(byte[] imageData)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | imageData | The new avatar image, as raw bytes. If null, the avatar will be set to the generic image. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
UpdateGroupDescription(String)
Updates the description of this Group.
Declaration
public Task<bool> UpdateGroupDescription(string description)
Parameters
| Type | Name | Description |
|---|---|---|
| String | description | The new description. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
UpdateGroupName(String)
Updates the name of this Group.
Declaration
public Task<bool> UpdateGroupName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The new group name. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
UpdateMemberAvatar(Byte[])
Declaration
public Task<bool> UpdateMemberAvatar(byte[] imageData)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | imageData | The new avatar image, as raw bytes. If null, the Member's global avatar will be used. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
UpdateNickname(String)
Declaration
public Task<bool> UpdateNickname(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The new nickname. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | A |
WhoAmI()
Returns the authenticated user.
Declaration
public Member WhoAmI()
Returns
| Type | Description |
|---|---|
| Member | A Member. |
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 |