New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

riddlet-bot

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

riddlet-bot

The official bot library for Riddlet

latest
Source
npmnpm
Version
0.11.4
Version published
Maintainers
1
Created
Source

logo

riddlet-bot

The official bot library for Riddlet, the anonymous chat application and server.

NPM

docs version

Installation

Installation is fairly simple. Just run npm install --save riddlet-bot in your project directory.

Your first bot

The official bot library allows for very barebones bot creation.

Simple Log Bot

To create a bot, you first want to create a new RiddletBot class.

var RiddletBot = require('riddlet-bot').RiddletBot

var bot = new RiddletBot("http://chat.example.com")

You should know if if this works when you get a token printed to your terminal. (ie: xxxxxxxxxxxxx.yyyyyyyyyyyy.zzzzzzzzzzzz)

We now want to stop the bot process and put that token as a second parameter. This allows our bot to have the same token each time it connects to the server.

var bot = new RiddletBot("http://chat.example.com", "xxxxxxxxxxxxx.yyyyyyyyyyyy.zzzzzzzzzzzz")

Your bot should now log every message it recieves from the server.

Custom Message Handler

Now to create a custom Message Handler.

Here is an example message handler that we will be using.

var xMessageHandler = function (bot, message) {
  if(message.data === "!info") {
    bot.SendMessage("test", "#all")
  }
}

Now we want to import it into our bot.

var bot = new RiddletBot("http://chat.example.com", "xxxxxxxxxxxxx.yyyyyyyyyyyy.zzzzzzzzzzzz", xMessageHandler)

And that's your first bot!

Keywords

chat

FAQs

Package last updated on 02 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts