Skip to main content

Interface IGuildChannel

Represents a generic guild channel.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public interface IGuildChannel : IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable

Properties​

Position​

Gets the position of this channel.

View Source​
Declaration
int Position { get; }

Guild​

Gets the guild associated with this channel.

View Source​
Declaration
IGuild Guild { get; }

GuildId​

Gets the guild ID associated with this channel.

View Source​
Declaration
ulong GuildId { get; }

PermissionOverwrites​

Gets a collection of permission overwrites for this channel.

View Source​
Declaration
IReadOnlyCollection<Overwrite> PermissionOverwrites { get; }

Methods​

ModifyAsync(Action<GuildChannelProperties>, RequestOptions)​

Modifies this guild channel.

View Source​
Declaration
Task ModifyAsync(Action<GuildChannelProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.Action<Discord.GuildChannelProperties>funcThe delegate containing the properties to modify the channel with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetPermissionOverwrite(IRole)​

Gets the permission overwrite for a specific role.

View Source​
Declaration
OverwritePermissions? GetPermissionOverwrite(IRole role)
Returns​

System.Nullable<Discord.OverwritePermissions>: An overwrite object for the targeted role; null if none is set.

Parameters​
TypeNameDescription
Discord.IRoleroleThe role to get the overwrite from.

GetPermissionOverwrite(IUser)​

Gets the permission overwrite for a specific user.

View Source​
Declaration
OverwritePermissions? GetPermissionOverwrite(IUser user)
Returns​

System.Nullable<Discord.OverwritePermissions>: An overwrite object for the targeted user; null if none is set.

Parameters​
TypeNameDescription
Discord.IUseruserThe user to get the overwrite from.

RemovePermissionOverwriteAsync(IRole, RequestOptions)​

Removes the permission overwrite for the given role, if one exists.

View Source​
Declaration
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​
TypeNameDescription
Discord.IRoleroleThe role to remove the overwrite from.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

RemovePermissionOverwriteAsync(IUser, RequestOptions)​

Removes the permission overwrite for the given user, if one exists.

View Source​
Declaration
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​
TypeNameDescription
Discord.IUseruserThe user to remove the overwrite from.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)​

Adds or updates the permission overwrite for the given role.

View Source​
Declaration
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​
TypeNameDescription
Discord.IRoleroleThe role to add the overwrite to.
Discord.OverwritePermissionspermissionsThe overwrite to add to the role.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)​

Adds or updates the permission overwrite for the given user.

View Source​
Declaration
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​
TypeNameDescription
Discord.IUseruserThe user to add the overwrite to.
Discord.OverwritePermissionspermissionsThe overwrite to add to the user.
Discord.RequestOptionsoptionsThe 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​
Declaration
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​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetUserAsync(UInt64, CacheMode, RequestOptions)​

Gets a user in this channel.

View Source​
Declaration
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​
TypeNameDescription
System.UInt64idThe snowflake identifier of the user.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.