Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a hackmud channel.

Hierarchy

  • Channel

Index

Constructors

constructor

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

Properties

Private api

name

name: string

The name of the channel

ownUser

ownUser: string

The account user related to the channel.

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

users

users: string[]

The users that are in this channel.

Methods

send

  • send(msg: string): Promise<void>
  • Send a message to the channel with ownUser

    Parameters

    • msg: string

      The message

    Returns Promise<void>

sendInterval

  • sendInterval(msg: string, interval: number): Timer
  • 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
  • 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
  • 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

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc