Class: BanchoChannel

BanchoChannel

Represents a discussion channel (not including PMs)


new BanchoChannel(banchojs, name)

Creates an instance of BanchoChannel.

Parameters:
Name Type Description
banchojs BanchoClient

bancho.js client

name string

Channel name as it is referred to on IRC (including #)

Properties:
Name Type Description
name string

Channel name as it is referred to on IRC (including #)

topic string
joined boolean

Whether we've joined the channel or not

channelMembers Map.<string, BanchoChannelMember>

Members of the channel, referenced by their name

Source:

Extends

  • EventEmitter

Methods


<async> join()

Join the channel

Source:
Returns:
Type
Promise.<null>

<async> leave()

Leave the channel

Source:
Returns:
Type
Promise.<null>

<async> sendAction(message)

Sends an ACTION message to this channel

Parameters:
Name Type Description
message string
Source:
Throws:

If we're offline

Type
Error
Returns:

Resolves when message is sent (rate-limiting)

Type
Promise.<null>

<async> sendMessage(message)

Sends a message to this channel

Elevated Bancho users are advised to heavily sanitize their inputs.

Parameters:
Name Type Description
message string
Source:
Throws:

If we're offline

Type
Error
Returns:

Resolves when message is sent (rate-limiting)

Type
Promise.<null>

Events


JOIN

Emitted when someone joins this channel

Type: BanchoChannelMember
Source:

message

Emitted when a message is received in a BanchoChannel

Type: ChannelMessage
Source:

PART

Emitted when someone leaves this channel

Type: BanchoChannelMember
Source: