Skip to main content

Class SocketGuildChannel

Represents a WebSocket-based guild channel.

Assembly: Discord.Net.WebSocket.dll​
View Source​
Declaration
public class SocketGuildChannel : SocketChannel, IGuildChannel, IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable

Properties​

Guild​

Gets the guild associated with this channel.

View Source​
Declaration
public SocketGuild Guild { get; }

Name​

Gets the name of this channel.

View Source​
Declaration
public string Name { get; }

Position​

Gets the position of this channel.

View Source​
Declaration
public int Position { get; }

PermissionOverwrites​

Gets a collection of permission overwrites for this channel.

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

Users​

Gets a collection of users that are able to view the channel.

View Source​
Declaration
public virtual IReadOnlyCollection<SocketGuildUser> Users { get; }

IGuildChannel.Guild​

Gets the guild associated with this channel.

View Source​
Declaration
IGuild IGuildChannel.Guild { get; }

IGuildChannel.GuildId​

Gets the guild ID associated with this channel.

View Source​
Declaration
ulong IGuildChannel.GuildId { get; }

Methods​

ModifyAsync(Action<GuildChannelProperties>, RequestOptions)​

Modifies this guild channel.

View Source​
Declaration
public 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.

DeleteAsync(RequestOptions)​

Deletes this object and all its children.

View Source​
Declaration
public Task DeleteAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetPermissionOverwrite(IUser)​

Gets the permission overwrite for a specific user.

View Source​
Declaration
public virtual 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.

GetPermissionOverwrite(IRole)​

Gets the permission overwrite for a specific role.

View Source​
Declaration
public virtual 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.

AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)​

Adds or updates the permission overwrite for the given user.

View Source​
Declaration
public virtual async 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.

AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)​

Adds or updates the permission overwrite for the given role.

View Source​
Declaration
public virtual async 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.

RemovePermissionOverwriteAsync(IUser, RequestOptions)​

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

View Source​
Declaration
public virtual async 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.

RemovePermissionOverwriteAsync(IRole, RequestOptions)​

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

View Source​
Declaration
public virtual async 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.

GetUser(UInt64)​

View Source​
Declaration
public virtual SocketGuildUser GetUser(ulong id)
Returns​

Discord.WebSocket.SocketGuildUser

Parameters​
TypeName
System.UInt64id

ToString()​

Gets the name of the channel.

View Source​
Declaration
public override string ToString()
Returns​

System.String: A string that resolves to Discord.WebSocket.SocketGuildChannel.Name.

IGuildChannel.GetPermissionOverwrite(IRole)​

Gets the permission overwrite for a specific role.

View Source​
Declaration
OverwritePermissions? IGuildChannel.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.

IGuildChannel.GetPermissionOverwrite(IUser)​

Gets the permission overwrite for a specific user.

View Source​
Declaration
OverwritePermissions? IGuildChannel.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.

IGuildChannel.AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)​

Adds or updates the permission overwrite for the given role.

View Source​
Declaration
async Task IGuildChannel.AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options)
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.

IGuildChannel.AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)​

Adds or updates the permission overwrite for the given user.

View Source​
Declaration
async Task IGuildChannel.AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options)
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.

IGuildChannel.RemovePermissionOverwriteAsync(IRole, RequestOptions)​

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

View Source​
Declaration
async Task IGuildChannel.RemovePermissionOverwriteAsync(IRole role, RequestOptions options)
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.

IGuildChannel.RemovePermissionOverwriteAsync(IUser, RequestOptions)​

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

View Source​
Declaration
async Task IGuildChannel.RemovePermissionOverwriteAsync(IUser user, RequestOptions options)
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.

IGuildChannel.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>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
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.

IGuildChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)​

Gets a user in this channel.

View Source​
Declaration
Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
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.

IChannel.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<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.IUser>>: 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.

IChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)​

Gets a user in this channel.

View Source​
Declaration
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.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.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the user (e.g. 168693960628371456).
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

Implements​