Table of Contents

Class RestGuildChannel

Namespace
Discord.Rest
Assembly
Discord.Net.Rest.dll

Represents a private REST-based group channel.

public class RestGuildChannel : RestChannel, IUpdateable, IGuildChannel, IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable
Inheritance
RestGuildChannel
Implements
Derived
Inherited Members
Extension Methods

Properties

Flags

Gets the flags related to this channel.

public ChannelFlags Flags { get; }

Property Value

ChannelFlags

A channel's flags, if any is associated.

Remarks

This value is determined by bitwise OR-ing ChannelFlags values together.

GuildId

Gets the guild ID associated with this channel.

public ulong GuildId { get; }

Property Value

ulong

An ulong representing the guild snowflake identifier for the guild that this channel belongs to.

Name

Gets the name of this channel.

public string Name { get; }

Property Value

string

A string containing the name of this channel.

PermissionOverwrites

Gets a collection of permission overwrites for this channel.

public virtual IReadOnlyCollection<Overwrite> PermissionOverwrites { get; }

Property Value

IReadOnlyCollection<Overwrite>

A collection of overwrites associated with this channel.

Position

Gets the position of this channel.

public int Position { get; }

Property Value

int

An int representing the position of this channel in the guild's channel list relative to others of the same type.

Methods

AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)

Adds or updates the permission overwrite for the given role.

public virtual Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null)

Parameters

role IRole

The role to add the overwrite to.

permissions OverwritePermissions

The overwrite to add to the role.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task representing the asynchronous permission operation for adding the specified permissions to the channel.

AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)

Adds or updates the permission overwrite for the given user.

public virtual Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null)

Parameters

user IUser

The user to add the overwrite to.

permissions OverwritePermissions

The overwrite to add to the user.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task representing the asynchronous permission operation for adding the specified permissions to the channel.

DeleteAsync(RequestOptions)

Deletes this object and all its children.

public Task DeleteAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

GetPermissionOverwrite(IRole)

Gets the permission overwrite for a specific role.

public virtual OverwritePermissions? GetPermissionOverwrite(IRole role)

Parameters

role IRole

The role to get the overwrite from.

Returns

OverwritePermissions?

An overwrite object for the targeted role; null if none is set.

GetPermissionOverwrite(IUser)

Gets the permission overwrite for a specific user.

public virtual OverwritePermissions? GetPermissionOverwrite(IUser user)

Parameters

user IUser

The user to get the overwrite from.

Returns

OverwritePermissions?

An overwrite object for the targeted user; null if none is set.

ModifyAsync(Action<GuildChannelProperties>, RequestOptions)

Modifies this guild channel.

public Task ModifyAsync(Action<GuildChannelProperties> func, RequestOptions options = null)

Parameters

func Action<GuildChannelProperties>

The delegate containing the properties to modify the channel with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous modification operation.

Remarks

This method modifies the current guild channel with the specified properties. To see an example of this method and what properties are available, please refer to GuildChannelProperties.

RemovePermissionOverwriteAsync(IRole, RequestOptions)

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

public virtual Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)

Parameters

role IRole

The role to remove the overwrite from.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task representing the asynchronous operation for removing the specified permissions from the channel.

RemovePermissionOverwriteAsync(IUser, RequestOptions)

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

public virtual Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null)

Parameters

user IUser

The user to remove the overwrite from.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task representing the asynchronous operation for removing the specified permissions from the channel.

ToString()

Gets the name of this channel.

public override string ToString()

Returns

string

A string that is the name of this channel.

UpdateAsync(RequestOptions)

Updates this object's properties with its current state.

public override Task UpdateAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task