Hierarchy

  • EventEmitter
    • Bot

Constructors

Properties

Methods

Constructors

  • The main bot class.

    Example

    import { Bot } from 'evangeline';

    const bot = new Bot(
    'evangeline test', {
    gatewayURL: 'wss://some.ws-url.xyz/ws/', // optional
    restURL: 'https://some.rest-url.xyz/' // optional
    })

    Parameters

    • author: string

      The author name of the to-be-sent messages. It must be 2-32 characters long.

    • Optional options: BotOptions

      The options for the bot.

    Returns Bot

Properties

author: string
rest: string
ws: null | WebSocket = null

Methods

  • Closes the connection to the Eludris gateway.

    Returns void

  • Connects to the Eludris gateway.

    Throws

    If author is not 2-32 characters long.

    Example

    import { Bot } from 'evangeline';

    const bot = new Bot('evangeline test')

    bot.connect()

    Returns void

  • A function to listen to certain events.

    Returns

    Bot

    Example

    import { Bot } from 'evangeline';

    const bot = new Bot('evangeline bot')

    bot.on('messageCreate', async (message) => {
    // event code here
    })

    bot.connect()

    Parameters

    • event: "messageCreate"

      The event to listen to.

    • listener: ((message: Message) => void)

      The parameters (if needed) to be used in the event.

        • (message: Message): void
        • Parameters

          • message: Message

          Returns void

    Returns Bot

  • Parameters

    • event: "ready"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Bot

  • Parameters

    • event: "error"
    • listener: ((error: Error) => void)
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns Bot

  • Send a message to Eludris. (Alias for sendMessage)

    Parameters

    • content: string

      The content of the message.

    Returns Promise<Message>

  • Send a message to Eludris.

    Example

    import { Bot } from 'evangeline';

    const bot = new Bot('evangeline test')

    bot.on('ready', async () => {
    await bot.sendMessage('woah, I\'m alive!')
    })

    Parameters

    • content: string

      The content of the message.

    Returns Promise<Message>

Generated using TypeDoc