Interface IChannel
- Namespace
- Discord
- Assembly
- Discord.Net.Core.dll
Represents a generic channel.
public interface IChannel : ISnowflakeEntity, IEntity<ulong>
- Inherited Members
- Extension Methods
Properties
ChannelType
Get the type of this channel.
ChannelType ChannelType { get; }
Property Value
Name
Gets the name of this channel.
string Name { get; }
Property Value
- string
A string containing the name of this channel.
Methods
GetUserAsync(ulong, CacheMode, RequestOptions)
Gets a user in this channel.
Task<IUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
idulongThe snowflake identifier of the user (e.g.
168693960628371456).modeCacheModeThe CacheMode that determines whether the object should be fetched from cache.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- Task<IUser>
A task that represents the asynchronous get operation. The task result contains a user object that represents the found user; null if none is found.
GetUsersAsync(CacheMode, RequestOptions)
Gets a collection of users that are able to view the channel or are currently in this channel.
IAsyncEnumerable<IReadOnlyCollection<IUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Parameters
modeCacheModeThe CacheMode that determines whether the object should be fetched from cache.
optionsRequestOptionsThe options to be used when sending the request.
Returns
- IAsyncEnumerable<IReadOnlyCollection<IUser>>
Paged collection of users.
Remarks
important
The returned collection is an asynchronous enumerable object; one must call FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>) to access the individual messages as a collection.
1000, the request will be split into 3 individual requests; thus returning 53individual asynchronous
responses, hence the need of flattening.