Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bot-relay

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bot-relay

send bot messages to real users, real name should bot-relay

  • 1.0.1-beta.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

relay

Bot user that can send messages to different users

npm version Dependency Status

Build Status Coverage Status Code Climate Join the chat at https://gitter.im/nshimiye/relay

Installation

npm install bot-relay

usage

  • Instance initialization
const relay = require('bot-relay');
let token = '<slack bot token>'; //@TODO add url to get this token
let slackRelay = relay.slackRelay(token);

slackRelay.connect().then( relayInstance => {
  // send messages to known users
  // broadcast messages to all users
  // post messages to channels
}, connectionError => {
  // you can try to reconnect
  // you can verify with slack to make sure your token is still valid
});
  • Turn the bot on and off.
slackRelay.connect(); // return promise - resolve with relay instance
slackRelay.disconnect(); // return promise - resolve with success message
  • Relay provide a "notify" method that takes in the user-name or channel-name
relayInstance.notify('<user-1>', 'user_typing');
  • Send message to slack user
  • given user name
  • use your bot to send a message to the above user.
relayInstance.send('Hi there!', '<user-1>');
  • Post in a slack channel
  • given a channel name
  • use your bot to post a message to the above channel.
relayInstance.post('Hello! I am alive :)', '<channel-1>');
  • Send message to slack user
relayInstance.broadcast('Sorry for spamming!', ['<user-1>', '<user-2>']);

Keywords

FAQs

Package last updated on 15 Apr 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc