# dazeus

> Node.js Bindings for DaZeus

Latest version **0.7.2** (published 2016-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install dazeus
pnpm add dazeus
yarn add dazeus
bun add dazeus
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.2 |
| Published | 2016-03-20 |
| First published | 2013-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ruben Nijveld |
| Maintainers | rnijveld |
| Keywords | dazeus, irc |

## Links

- npm: https://www.npmjs.com/package/dazeus
- Repository: https://github.com/%3Adazeus/dazeus-nodejs
- Homepage: https://github.com/%3Adazeus/dazeus-nodejs#readme
- Issues: https://github.com/%3Adazeus/dazeus-nodejs/issues
- npm.io page: https://npm.io/package/dazeus

## Dependencies (1)

- [prettydate](https://npm.io/package/prettydate.md)

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.7.2 (latest) — 2016-03-20
- 0.7.1 — 2014-10-08
- 0.7.0 — 2014-10-03
- 0.6.0 — 2014-04-16
- 0.5.0 — 2013-05-30
- 0.4.3 — 2013-03-12
- 0.4.2 — 2013-03-12
- 0.4.1 — 2013-03-10
- 0.4.0 — 2013-03-03
- 0.3.4 — 2013-03-03
- 0.3.3 — 2013-02-12
- 0.3.2 — 2013-01-30
- 0.3.1 — 2013-01-30
- 0.3.0 — 2013-01-30
- 0.2.0 — 2013-01-30
- … 1 more at https://npm.io/package/dazeus/versions

## README

# DaZeus Node.js Bindings
This package provides bindings for the DaZeus IRC Bot

## Getting started
Here's an example echobot, that just repeats every message back to the channel

    var dazeus = require("dazeus");
    var client = dazeus.connect({path: '/tmp/dazeus.sock'}, function () {
        client.on('PRIVMSG', function (network, user, channel, message) {
            client.message(network, channel, message);
        });
    });

## Quick Reference
We start by setting up a new instance of the client:

    var dazeus = require("dazeus");
    var client = dazeus.connect({path: '/tmp/dazeus.sock'}, function () {

    });

The connect function will return a client object that can be used to query the server
and which will respond to anything DaZeus throws at it. Instead of providing a `path`
variable you may also provide a `host` and `port` to connect using TCP.

The provided callback function will be executed as soon as a connection is established.
By creating your own listeners and triggering your own actions you can interact with DaZeus

### Events
Events may be captured by using the `on` method on a client object. Please take a look at
the DaZeus documentation to see what events are available. The event interface used is that from
Node.js's events.EventEmitter. Take a look at their documentation to see how listening to events
works in Node.js

Callback arguments depend on the parameters returned by DaZeus. Events you can listen for are:

- `CONNECT`
- `DISCONNECT`
- `JOIN`
- `PART`
- `QUIT`
- `NICK`
- `MODE`
- `TOPIC`
- `INVITE`
- `KICK`
- `PRIVMSG`
- `NOTICE`
- `CTCP`
- `CTCP_REP`
- `ACTION`
- `UNKNOWN`
- `WHOIS`
- `NAMES`
- `PRIVMSG_ME`
- `CTCP_ME`
- `ACTION_ME`

Some examples to get you going:

    client.on('PRIVMSG', function (network, user, channel, message) {
        // every event has a different set of parameters
    });

    client.on('WHOIS', function (network, server, user) {
        // you don't need to specify all parameters if you don't need them
    });

### Methods
All these methods provide callbacks that are executed when the information requested is provided
by the bot. Sometimes this information might be limited to a confirmation of the action performed.


    DaZeus.getProperty(property[, scope], callback)

Retrieve a property from the database DaZeus provides.


    DaZeus.setProperty(property, value[, scope][, callback])

Store a property in the DaZeus database.


    DaZeus.unsetProperty(property[, scope][, callback])

Remove a property from the DaZeus database.


    DaZeus.propertyKeys(property[, scope], callback)

Retrieve all keys starting with the given name.


    DaZeus.getPermission(permission, scope[, default], callback)

Get a permission (with the given default as a default).


    DaZeus.setPermission(permission, scope, allow[, callback])

Set a permission to the given allow or denied value (true for allow, false for deny).


    DaZeus.unsetPermission(permission, scope[, callback])

Remove a permission.


    DaZeus.message(network, channel, message[, callback])

Send a message to a specific channel on a specific network.


    DaZeus.action(network, channel, message[, callback])

Send a '/me' message to a specific channel on a specific network.


    DaZeus.notice(network, channel, message[, callback])

Send a notice to a specific channel on a specific network.


    DaZeus.ctcp(network, channel, message[, callback])

Send a CTCP request to a specific channel on a specific network.


    DaZeus.ctcpReply(network, channel, message[, callback])

Send a CTCP reply to a specific channel on a specific network.


    DaZeus.join(network, channel[, callback])

Join a channel.


    DaZeus.part(network, channel[, callback])

Leave a channel.


    DaZeus.names(network, channel, callback)

Request the list of names in a channel (mode characters are prepended).


    DaZeus.nicknames(network, channel, callback)

Request the list of nicknames (with any prefixes removed) in a channel.


    DaZeus.networks(callback)

Retrieve the list of networks the bot is connected to.


    DaZeus.channels(network, callback)

Retrieve the list of channels the bot has joined for a network.


    DaZeus.nick(network, callback)

Retrieve the nickname of the bot.


    DaZeus.whois(network, nick, callback)

Send a '/whois' request for a specific nick on a network.

    DaZeus.onCommand(command[, network], callback)

Receive a notification when a command is executed, for example to catch `}help` you would write:
`DaZeus.onCommand('help', function () { /* ... */ });`

    DaZeus.reply(network, channel, user, message[, highlight][, callback])

Reply to a message sent by a user in a channel. By default the bot will also add a highlight for
the user if the channel is public. This function will also automatically resolve replies in private
conversations.

---
_Source: https://npm.io/package/dazeus · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
