Class RestDMChannel
Represents a REST-based direct-message channel.
Inheritance
RestDMChannel
Assembly: Discord.Net.Rest.dll
Syntax
public class RestDMChannel : RestChannel, IEntity<ulong>, IUpdateable, IDMChannel, IRestPrivateChannel, IPrivateChannel, IRestMessageChannel, IMessageChannel, IChannel, ISnowflakeEntity, IEntity<ulong>
Properties
|
Improve this Doc
View Source
CurrentUser
Gets the current logged-in user.
Declaration
public RestUser CurrentUser { get; }
Property Value
|
Improve this Doc
View Source
Recipient
Gets the recipient of the channel.
Declaration
public RestUser Recipient { get; }
Property Value
|
Improve this Doc
View Source
Users
Gets a collection that is the current logged-in user and the recipient.
Declaration
public IReadOnlyCollection<RestUser> Users { get; }
Property Value
Type |
Description |
IReadOnlyCollection<RestUser> |
|
Methods
|
Improve this Doc
View Source
CloseAsync(RequestOptions)
Declaration
public Task CloseAsync(RequestOptions options = null)
Parameters
Returns
|
Improve this Doc
View Source
DeleteMessageAsync(IMessage, RequestOptions)
Declaration
public Task DeleteMessageAsync(IMessage message, RequestOptions options = null)
Parameters
Returns
|
Improve this Doc
View Source
DeleteMessageAsync(UInt64, RequestOptions)
Declaration
public Task DeleteMessageAsync(ulong messageId, RequestOptions options = null)
Parameters
Returns
|
Improve this Doc
View Source
EnterTypingState(RequestOptions)
Declaration
public IDisposable EnterTypingState(RequestOptions options = null)
Parameters
Returns
Type |
Description |
IDisposable |
|
|
Improve this Doc
View Source
GetMessageAsync(UInt64, RequestOptions)
Gets a message from this message channel.
Declaration
public Task<RestMessage> GetMessageAsync(ulong id, RequestOptions options = null)
Parameters
Type |
Name |
Description |
UInt64 |
id |
The snowflake identifier of the message.
|
RequestOptions |
options |
The options to be used when sending the request.
|
Returns
Type |
Description |
Task<RestMessage> |
A task that represents an asynchronous get operation for retrieving the message. The task result contains
the retrieved message; null if no message is found with the specified identifier.
|
|
Improve this Doc
View Source
GetMessagesAsync(IMessage, Direction, Int32, RequestOptions)
Gets a collection of messages in this channel.
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(IMessage fromMessage, Direction dir, int limit = null, RequestOptions options = null)
Parameters
Type |
Name |
Description |
IMessage |
fromMessage |
The starting message to get the messages from.
|
Direction |
dir |
The direction of the messages to be gotten from.
|
Int32 |
limit |
The numbers of message to be gotten from.
|
RequestOptions |
options |
The options to be used when sending the request.
|
Returns
Type |
Description |
IAsyncEnumerable<IReadOnlyCollection<RestMessage>> |
Paged collection of messages.
|
|
Improve this Doc
View Source
GetMessagesAsync(Int32, RequestOptions)
Gets the last N messages from this message channel.
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(int limit = null, RequestOptions options = null)
Parameters
Type |
Name |
Description |
Int32 |
limit |
The numbers of message to be gotten from.
|
RequestOptions |
options |
The options to be used when sending the request.
|
Returns
Type |
Description |
IAsyncEnumerable<IReadOnlyCollection<RestMessage>> |
Paged collection of messages.
|
|
Improve this Doc
View Source
GetMessagesAsync(UInt64, Direction, Int32, RequestOptions)
Gets a collection of messages in this channel.
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestMessage>> GetMessagesAsync(ulong fromMessageId, Direction dir, int limit = null, RequestOptions options = null)
Parameters
Type |
Name |
Description |
UInt64 |
fromMessageId |
The ID of the starting message to get the messages from.
|
Direction |
dir |
The direction of the messages to be gotten from.
|
Int32 |
limit |
The numbers of message to be gotten from.
|
RequestOptions |
options |
The options to be used when sending the request.
|
Returns
Type |
Description |
IAsyncEnumerable<IReadOnlyCollection<RestMessage>> |
Paged collection of messages.
|
|
Improve this Doc
View Source
GetPinnedMessagesAsync(RequestOptions)
Gets a collection of pinned messages in this channel.
Declaration
public Task<IReadOnlyCollection<RestMessage>> GetPinnedMessagesAsync(RequestOptions options = null)
Parameters
Type |
Name |
Description |
RequestOptions |
options |
The options to be used when sending the request.
|
Returns
Type |
Description |
Task<IReadOnlyCollection<RestMessage>> |
A task that represents the asynchronous get operation for retrieving pinned messages in this channel.
The task result contains a collection of messages found in the pinned messages.
|
|
Improve this Doc
View Source
GetUser(UInt64)
Gets a user in this channel from the provided id
.
Declaration
public RestUser GetUser(ulong id)
Parameters
Type |
Name |
Description |
UInt64 |
id |
The snowflake identifier of the user.
|
Returns
Type |
Description |
RestUser |
A RestUser object that is a recipient of this channel; otherwise null .
|
|
Improve this Doc
View Source
ModifyMessageAsync(UInt64, Action<MessageProperties>, RequestOptions)
Declaration
public async Task<IUserMessage> ModifyMessageAsync(ulong messageId, Action<MessageProperties> func, RequestOptions options = null)
Parameters
Returns
|
Improve this Doc
View Source
SendFileAsync(FileAttachment, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[], MessageFlags)
Declaration
public Task<RestUserMessage> SendFileAsync(FileAttachment attachment, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = default(MessageFlags))
Parameters
Returns
|
Improve this Doc
View Source
SendFileAsync(Stream, String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[], MessageFlags)
Declaration
public Task<RestUserMessage> SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = default(MessageFlags))
Parameters
Returns
|
Improve this Doc
View Source
SendFileAsync(String, String, Boolean, Embed, RequestOptions, Boolean, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[], MessageFlags)
Declaration
public Task<RestUserMessage> SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = default(MessageFlags))
Parameters
Returns
|
Improve this Doc
View Source
SendFilesAsync(IEnumerable<FileAttachment>, String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[], MessageFlags)
Declaration
public Task<RestUserMessage> SendFilesAsync(IEnumerable<FileAttachment> attachments, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = default(MessageFlags))
Parameters
Returns
|
Improve this Doc
View Source
SendMessageAsync(String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[], MessageFlags)
Declaration
public Task<RestUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = default(MessageFlags))
Parameters
Returns
|
Improve this Doc
View Source
ToString()
Gets a string that represents the Username#Discriminator of the recipient.
Declaration
public override string ToString()
Returns
Type |
Description |
String |
A string that resolves to the Recipient of this channel.
|
|
Improve this Doc
View Source
TriggerTypingAsync(RequestOptions)
Declaration
public Task TriggerTypingAsync(RequestOptions options = null)
Parameters
Returns
|
Improve this Doc
View Source
UpdateAsync(RequestOptions)
Declaration
public override async Task UpdateAsync(RequestOptions options = null)
Parameters
Returns
Overrides
Explicit Interface Implementations
|
Improve this Doc
View Source
IDMChannel.Recipient
Gets the recipient of all messages in this channel.
Declaration
IUser IDMChannel.Recipient { get; }
Returns
Type |
Description |
IUser |
A user object that represents the other user in this channel.
|
|
Improve this Doc
View Source
IRestPrivateChannel.Recipients
Users that can access this channel.
Declaration
IReadOnlyCollection<RestUser> IRestPrivateChannel.Recipients { get; }
Returns
Type |
Description |
IReadOnlyCollection<RestUser> |
|
Implements