Show / Hide Table of Contents

Class SocketChannel

Represents a WebSocket-based channel.

Inheritance
System.Object
SocketEntity<System.UInt64>
SocketChannel
SocketDMChannel
SocketGroupChannel
SocketGuildChannel
Implements
IChannel
ISnowflakeEntity
IEntity<System.UInt64>
Inherited Members
SocketEntity<UInt64>.Id
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Discord.WebSocket
Assembly: Discord.Net.WebSocket.dll
Syntax
public abstract class SocketChannel : SocketEntity<ulong>, IChannel, ISnowflakeEntity, IEntity<ulong>

Properties

| Improve this Doc View Source

CreatedAt

Gets when the channel is created.

Declaration
public DateTimeOffset CreatedAt { get; }
Property Value
Type Description
System.DateTimeOffset
| Improve this Doc View Source

Users

Gets a collection of users from the WebSocket cache.

Declaration
public IReadOnlyCollection<SocketUser> Users { get; }
Property Value
Type Description
System.Collections.Generic.IReadOnlyCollection<SocketUser>

Methods

| Improve this Doc View Source

GetUser(UInt64)

Gets a generic user from this channel.

Declaration
public SocketUser GetUser(ulong id)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier of the user.

Returns
Type Description
SocketUser

A generic WebSocket-based user associated with the snowflake identifier.

Explicit Interface Implementations

| Improve this Doc View Source

IChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)

Gets a user in this channel.

Declaration
Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Parameters
Type Name Description
System.UInt64 id

The snowflake identifier of the user (e.g. 168693960628371456).

CacheMode mode

The CacheMode that determines whether the object should be fetched from cache.

RequestOptions options

The options to be used when sending the request.

Returns
Type Description
System.Threading.Tasks.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.

| Improve this Doc View Source

IChannel.Name

Gets the name of this channel.

Declaration
string IChannel.Name { get; }
Returns
Type Description
System.String

A string containing the name of this channel.

Implements

IChannel
ISnowflakeEntity
IEntity<TId>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX