Socket
Socket
Sign inDemoInstall

hubot-longtext

Package Overview
Dependencies
93
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hubot-longtext

A Hubot script for handling long messages by returning a link to an online paste containing the message.


Version published
Weekly downloads
2
Maintainers
1
Install size
174 kB
Created
Weekly downloads
 

Readme

Source

hubot-longtext

Build Status devDependency Status

This script relies on a new Hubot v2.17.0 feature known as 'response middleware'. It WILL NOT work on older versions of Hubot.

A Hubot script for handling long messages by returning a link to an online paste containing the message.

This script is useful for automatically capturing long Hubot responses (e.g. help text) that would otherwise flood your chat channel / room. A captured response is then converted into an online paste, and a link to the paste is returned.

Process

  • If enabled, check if the number of string lines is more than HUBOT_LONGTEXT_MAX_LINES (accounts for \n, and \r);
  • If the previous condition is not met, check if the number of characters for each string exceeds HUBOT_LONGTEXT_MAX;
  • If any of the condition above is met, the string is exported to an online paste.

See src/longtext.coffee for full documentation.

Installation via NPM

  1. Install the hubot-longtext module as a Hubot dependency by running:

    npm install --save hubot-longtext
    
  2. Enable the module by adding the hubot-longtext entry to your external-scripts.json file:

    [
        "hubot-longtext"
    ]
    
  3. Run your bot and see below for available config / commands

Configuration

VariableDefaultDescription
HUBOT_LONGTEXT_MAX300Any message sent by Hubot that is longer than HUBOT_LONGTEXT_MAX string characters will be replaced with a link to the paste containing the message
HUBOT_LONGTEXT_MAX_LINESfalseAny message sent by Hubot with more than HUBOT_LONGTEXT_MAX_LINES string lines will be replaced with a link to the paste containing the message (disabled by default)
HUBOT_LONGTEXT_SERVICEDpaste(TBA)

Sample Interaction

user1>> hubot help
hubot>> http://dpaste.com/0TGWQ8T

Keywords

FAQs

Last updated on 28 Nov 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc