Interface IGuildChannel
Represents a generic guild channel.
Assembly: Discord.Net.Core.dll​
View Source​
public interface IGuildChannel : IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable
Properties​
Position​
Gets the position of this channel.
View Source​
int Position { get; }
Guild​
Gets the guild associated with this channel.
View Source​
IGuild Guild { get; }
GuildId​
Gets the guild ID associated with this channel.
View Source​
ulong GuildId { get; }
PermissionOverwrites​
Gets a collection of permission overwrites for this channel.
View Source​
IReadOnlyCollection<Overwrite> PermissionOverwrites { get; }
Methods​
ModifyAsync(Action<GuildChannelProperties>, RequestOptions)​
Modifies this guild channel.
View Source​
Task ModifyAsync(Action<GuildChannelProperties> func, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous modification operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Action<Discord.GuildChannelProperties> | func | The delegate containing the properties to modify the channel with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetPermissionOverwrite(IRole)​
Gets the permission overwrite for a specific role.
View Source​
OverwritePermissions? GetPermissionOverwrite(IRole role)
Returns​
System.Nullable<Discord.OverwritePermissions>
:
An overwrite object for the targeted role; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to get the overwrite from. |
GetPermissionOverwrite(IUser)​
Gets the permission overwrite for a specific user.
View Source​
OverwritePermissions? GetPermissionOverwrite(IUser user)
Returns​
System.Nullable<Discord.OverwritePermissions>
:
An overwrite object for the targeted user; null
if none is set.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to get the overwrite from. |
RemovePermissionOverwriteAsync(IRole, RequestOptions)​
Removes the permission overwrite for the given role, if one exists.
View Source​
Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous operation for removing the specified permissions from the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to remove the overwrite from. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemovePermissionOverwriteAsync(IUser, RequestOptions)​
Removes the permission overwrite for the given user, if one exists.
View Source​
Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous operation for removing the specified permissions from the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to remove the overwrite from. |
Discord.RequestOptions | options | The options to be used when sending the request. |
AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)​
Adds or updates the permission overwrite for the given role.
View Source​
Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous permission operation for adding the specified permissions to the
channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to add the overwrite to. |
Discord.OverwritePermissions | permissions | The overwrite to add to the role. |
Discord.RequestOptions | options | The options to be used when sending the request. |
AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)​
Adds or updates the permission overwrite for the given user.
View Source​
Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task representing the asynchronous permission operation for adding the specified permissions to the channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IUser | user | The user to add the overwrite to. |
Discord.OverwritePermissions | permissions | The overwrite to add to the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetUsersAsync(CacheMode, RequestOptions)​
Gets a collection of users that are able to view the channel or are currently in this channel.
View Source​
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IGuildUser>>
:
Paged collection of users.
Parameters​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
GetUserAsync(UInt64, CacheMode, RequestOptions)​
Gets a user in this channel.
View Source​
Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.IGuildUser>
:
A task representing the asynchronous get operation. The task result contains a guild user object that
represents the user; null
if none is found.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the user. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |