Represents a hackmud channel.

### Hierarchy

- Channel

## Index

### Constructors

- constructor

### Properties

- api
- name
- ownUser
- users

### Methods

- send
- sendInterval
- sendIntervalRandom
- sendIntervalSequence

## Constructors

### constructor

- new Channel(api: HackmudApi, name: string, users: string[], ownUser: string): Channel

- - Defined in lib/channel.ts:30

  #### Parameters

  - ##### api: HackmudApi

  - ##### name: string

  - ##### users: string[]

  - ##### ownUser: string

  #### Returns Channel

## Properties

### Private api

api: HackmudApi

- Defined in lib/channel.ts:30

### name

name: string

- Defined in lib/channel.ts:23

The name of the channel

### ownUser

ownUser: string

- Defined in lib/channel.ts:29

The account user related to the channel.

The one that it's to send the messages from when using send(), etc.

### users

users: string[]

- Defined in lib/channel.ts:19

The users that are in this channel.

## Methods

### send

- send(msg: string): Promise<void>

- - Defined in lib/channel.ts:43

  Send a message to the channel with ownUser

  #### Parameters

  - ##### msg: string

    The message

  #### Returns Promise<void>

### sendInterval

- sendInterval(msg: string, interval: number): Timer

- - Defined in lib/channel.ts:52

  Send a message every x ms.

  #### Parameters

  - ##### msg: string

    The message

  - ##### interval: number

    Interval in ms

  #### Returns Timer

### sendIntervalRandom

- sendIntervalRandom(msgs: string[], interval: number): Timer

- - Defined in lib/channel.ts:79

  Every interval ms send a random message from the given array.

  #### Parameters

  - ##### msgs: string[]

    The messages

  - ##### interval: number

    Interval in ms

  #### Returns Timer

### sendIntervalSequence

- sendIntervalSequence(msgs: string[], interval: number): Timer

- - Defined in lib/channel.ts:63

  Sends the messages in the array in the order given separated by the specified time.

  #### Parameters

  - ##### msgs: string[]

    The messages

  - ##### interval: number

    Interval in ms

  #### Returns Timer

Generated using TypeDoc