Skip to content

Class: ChannelEndpoint ​

Defined in: endpoints/channel.ts:20

Constructors ​

Constructor ​

ts
new ChannelEndpoint(client): ChannelEndpoint;

Defined in: endpoints/channel.ts:21

Parameters ​

ParameterType
clientRESTClient

Returns ​

ChannelEndpoint

Methods ​

addPrivateChannelMembers() ​

ts
addPrivateChannelMembers(channelId, params): Promise<ICreateChannelResponse>;

Defined in: endpoints/channel.ts:100

Bring friends into a conversation you are in. They can read everything said in it so far; a conversation without that history is a new group, made with createPrivateChannel. Answers with the conversation and its members as they now are.

Parameters ​

ParameterType
channelIdnumber
params{ userIds: number[]; }
params.userIdsnumber[]

Returns ​

Promise<ICreateChannelResponse>


createCategory() ​

ts
createCategory(serverId, params): Promise<ICreateCategoryResponse>;

Defined in: endpoints/channel.ts:143

Parameters ​

ParameterType
serverIdnumber
params{ name: string; }
params.namestring

Returns ​

Promise<ICreateCategoryResponse>


createChannel() ​

ts
createChannel(serverId, params): Promise<ICreateChannelResponse>;

Defined in: endpoints/channel.ts:27

Parameters ​

ParameterType
serverIdnumber
params{ accessRoleIds?: number[]; categoryId?: number; isNsfw?: boolean; isPrivate?: boolean; name: string; type?: string; }
params.accessRoleIds?number[]
params.categoryId?number
params.isNsfw?boolean
params.isPrivate?boolean
params.namestring
params.type?string

Returns ​

Promise<ICreateChannelResponse>


createPrivateChannel() ​

ts
createPrivateChannel(params): Promise<ICreateChannelResponse>;

Defined in: endpoints/channel.ts:90

Parameters ​

ParameterType
params{ userIds: number[]; }
params.userIdsnumber[]

Returns ​

Promise<ICreateChannelResponse>


deleteCategory() ​

ts
deleteCategory(serverId, categoryId): Promise<IDeleteCategoryResponse>;

Defined in: endpoints/channel.ts:160

its channels stay, moved out of any category

Parameters ​

ParameterType
serverIdnumber
categoryIdnumber

Returns ​

Promise<IDeleteCategoryResponse>


deleteChannel() ​

ts
deleteChannel(serverId, channelId): Promise<IDeleteChannelResponse>;

Defined in: endpoints/channel.ts:77

Parameters ​

ParameterType
serverIdnumber
channelIdnumber

Returns ​

Promise<IDeleteChannelResponse>


deletePrivateChannelHistory() ​

ts
deletePrivateChannelHistory(channelId): Promise<IPrivateChannelVisibilityResponse>;

Defined in: endpoints/channel.ts:127

Delete a direct message for yourself: it leaves your list and you are no longer given anything said in it so far. The others keep their history, and a new message brings it back with only what follows.

Parameters ​

ParameterType
channelIdnumber

Returns ​

Promise<IPrivateChannelVisibilityResponse>


duplicateChannel() ​

ts
duplicateChannel(
   serverId, 
   channelId, 
   params?
): Promise<ICreateChannelResponse>;

Defined in: endpoints/channel.ts:69

A copy of a channel - its type, category, topic, limits and permissions - placed just below it. Nothing said in it is copied.

Parameters ​

ParameterType
serverIdnumber
channelIdnumber
params?{ name?: string; }
params.name?string

Returns ​

Promise<ICreateChannelResponse>


getChannelMembers() ​

ts
getChannelMembers(channelId): Promise<IChannelMembersResponse>;

Defined in: endpoints/channel.ts:23

Parameters ​

ParameterType
channelIdnumber

Returns ​

Promise<IChannelMembersResponse>


getPrivateChannels() ​

ts
getPrivateChannels(): Promise<IPrivateChannelsResponse>;

Defined in: endpoints/channel.ts:81

Returns ​

Promise<IPrivateChannelsResponse>


hidePrivateChannel() ​

ts
hidePrivateChannel(channelId): Promise<IPrivateChannelVisibilityResponse>;

Defined in: endpoints/channel.ts:114

take a direct message out of your list (and its badge) until someone writes in it again

Parameters ​

ParameterType
channelIdnumber

Returns ​

Promise<IPrivateChannelVisibilityResponse>


removePrivateChannelMember() ​

ts
removePrivateChannelMember(
   channelId, 
   userId, 
   options?
): Promise<void>;

Defined in: endpoints/channel.ts:105

Your own id leaves. The final member must confirm deleting the conversation and its history.

Parameters ​

ParameterType
channelIdnumber
userIdnumber
options?{ deleteIfLast?: boolean; }
options.deleteIfLast?boolean

Returns ​

Promise<void>


renamePrivateChannel() ​

ts
renamePrivateChannel(channelId, name): Promise<ICreateChannelResponse>;

Defined in: endpoints/channel.ts:86

Set the shared name; an empty string restores participant names.

Parameters ​

ParameterType
channelIdnumber
namestring

Returns ​

Promise<ICreateChannelResponse>


showPrivateChannel() ​

ts
showPrivateChannel(channelId): Promise<IPrivateChannelVisibilityResponse>;

Defined in: endpoints/channel.ts:118

Parameters ​

ParameterType
channelIdnumber

Returns ​

Promise<IPrivateChannelVisibilityResponse>


updateCategory() ​

ts
updateCategory(
   serverId, 
   categoryId, 
   params
): Promise<IUpdateCategoryResponse>;

Defined in: endpoints/channel.ts:151

Rename or move a category, or change who can see it. Access changes carry over to every channel synced with it.

Parameters ​

ParameterType
serverIdnumber
categoryIdnumber
params{ accessRoleIds?: number[]; isPrivate?: boolean; name?: string; position?: number; }
params.accessRoleIds?number[]
params.isPrivate?boolean
params.name?string
params.position?number

Returns ​

Promise<IUpdateCategoryResponse>


updateChannel() ​

ts
updateChannel(
   serverId, 
   channelId, 
   params
): Promise<IUpdateChannelResponse>;

Defined in: endpoints/channel.ts:42

Parameters ​

ParameterType
serverIdnumber
channelIdnumber
params{ accessRoleIds?: number[]; categoryId?: number | null; description?: string | null; isNsfw?: boolean; isPrivate?: boolean; name?: string; position?: number; slowModeSeconds?: number; syncWithCategory?: true; userLimit?: number; }
params.accessRoleIds?number[]
params.categoryId?number | null
params.description?string | null
params.isNsfw?boolean
params.isPrivate?boolean
params.name?string
params.position?number
params.slowModeSeconds?number
params.syncWithCategory?true
params.userLimit?number

Returns ​

Promise<IUpdateChannelResponse>


updateLayout() ​

ts
updateLayout(serverId, params): Promise<IServerChannelsResponse>;

Defined in: endpoints/channel.ts:136

Move and reorder channels and categories in one request - what a drag in the sidebar does. Answers with the channels and categories as the caller now sees them.

Parameters ​

ParameterType
serverIdnumber
params{ categories?: ICategoryPlacement[]; channels?: IChannelPlacement[]; }
params.categories?ICategoryPlacement[]
params.channels?IChannelPlacement[]

Returns ​

Promise<IServerChannelsResponse>

Released under the GNU Affero General Public License v3.0.