Jbot
An Unreasonable HipChat Bot
Install / Use
/learn @jschauma/JbotREADME
This is a Slack version of the 'jbot' IRC bot, originally "developed" at Yahoo! in 2007, and which can be found in the 'old/irc' subdir.
This variant was created as a rewrite in Go for HipChat in July 2016 by Jan Schaumann (@jschauma / jschauma@netmeister.org). Support for Slack was added in July 2017. Many thanks to Yahoo for letting me play around with nonsense like this.
You should be able to run the bot by populating a configuration file with suitable values. The following configuration values are required:
slackService = the Slack service name, e.g. <foo>.slack.com
slackToken = the authentication token for your bot
You may optionally also set the following configuration values:
channelFile = pathname where to store a state file
debug = whether to enable debugging output
opsgenieApiKey = an API key to access OpsGenie
This bot has a bunch of features that are company internal; those features have been removed from this public version.
Some day this should be extended into a pluggable bot, so that internal code can more easily be kept apart, I suppose. Pull requests welcome etc.
Some of the URLs used by the bot reference simple text documents hosted on an internal server. This is so as to not rely on outside resources and their flimsy markups as well as to control the contents somewhat. You can update the URLS map in jbot.go.
Interacting with the bot:
Getting jbot to join your channel:
/invite jbot
Getting jbot to leave your channel:
!leave
(Note: on Slack, bots cannot leave a channel and require an admin to kick them.)
jbot responds to:
- commands invoked via '!command' -- see '!help'
- commands invoked via @-mentioning the bot: !command => "@jbot command" !command arg => "@jbot command arg"
If 'chatter' is not toggled off (it is on by default), jbot will also:
-
reply to any statement that is addressed to it: How are you today, jbot? jbot, you suck
-
chime in with certain semi-random replies (sure, you got the source, but the fun part is figuring out what triggers what type of response); some of these responses are throttled to avoid too repetitive annoyances
You may wish to '!toggle chatter' to turn all that off.
All private messages to jbot are interpreted as commands. You cannot engage in a private conversation with jbot.
Supported commands
The full list of public features can be seen via the "!help" command.
The following is a list of commands supported as of 2016-09-09 with examples.
!8ball <question> -- ask the magic 8-ball
Ask the magic 8-ball. You get the expected reply. E.g.:
16:16 <jschauma> !8ball is this a useful feature?
16:16 <jbot> My sources say no.
!asn <hostname|ip|asn> -- display information about ASN
16:20 <jschauma> !asn www.yahoo.com
16:20 <jbot> 36646 | 98.138.49.66 | YAHOO-NE1 - Yahoo, US
16:20 <jschauma> !asn 98.138.49.66
16:20 <jbot> 36646 | 98.138.49.66 | YAHOO-NE1 - Yahoo, US
16:20 <jschauma> !asn 36646
16:20 <jbot> YAHOO-NE1 - Yahoo, US
!bacon -- when you just need some more meat in your life
12:42 <jschauma> !bacon
12:42 <jbot> Strip steak burgdoggen pork chop prosciutto tenderloin, brisket doner porchetta jowl pork ham hock meatloaf.
!beer -- obey your thirst
20:57 <@jschauma> !beer
20:57 < jbot> AleSmith Speedway Stout by AleSmith Brewing Company - 4.37
20:57 < jbot> American Double / Imperial Stout (12.00%)
20:57 < jbot> https://www.beeradvocate.com/beer/profile/396/3833/
20:58 <@jschauma> !beer bacon
20:58 < jbot> Maple Bacon Coffee Porter by Funky Buddha Brewery - 4.45
20:58 < jbot> American Porter (6.40%)
20:58 < jbot> https://www.beeradvocate.com/beer/profile/31805/62761/
!bs -- Corporate B.S. Generator
16:18 <jans> !bs
16:18 <jbot> energistically reconceptualize real-time intellectual capital
!cert -- display information about the x509 cert found at the given hostname
This command allows you to display information about the x509 certificate from the given host.</p>
You can specify a hostname or an IP address followed optionally by a port. If a port is not provided, jbot will try port 443. You can also provide an optional SNI name as well as ask for the full chain:
16:22 <@jans> !cert www.yahoo.com
16:22 < jbot> Serial Number: 08:88:b1:ad:2a:59:33:10:59:3f:47:56:5a:5a:5a:4a
Subject : CN=*.www.yahoo.com,O=Yahoo Holdings\, Inc.,L=Sunnyvale,ST=California,C=US
Issuer : CN=DigiCert SHA2 High Assurance Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US
Validity :
Not Before: 2018-08-13 00:00:00 +0000 UTC
Not After : 2019-02-14 12:00:00 +0000 UTC
44 SANs:
...
16:22 <@jans> !cert www.yahoo.com chain
16:22 < jbot> Certificate 0:
Serial Number: 08:88:b1:ad:2a:59:33:10:59:3f:47:56:5a:5a:5a:4a
Subject : CN=*.www.yahoo.com,O=Yahoo Holdings\, Inc.,L=Sunnyvale,ST=California,C=US
...
Certificate 1:
Serial Number: 04:e1:e7:a4:dc:5c:f2:f3:6d:c0:2b:42:b8:5d:15:9f
Subject : CN=DigiCert SHA2 High Assurance Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US
...
16:22 <@jans> !cert badssl.com extended-validation.badssl.com
16:22 < jbot> Serial Number: 03:6a:f1:d4:8f:7e:5f:22:2a:8c:45:25:f0:12:c9:e1
Subject : SERIALNUMBER=C2543436,CN=extended-validation.badssl.com,O=Mozilla Foundation,L=Mountain View,ST=California,C=US
...
!channels -- display channels I'm in
16:22 <jschauma> !channels
16:22 <jbot> I'm in the following 2 channels:
16:22 <jbot> foo, bar
!clear [num] -- clear the screen / backlog
Suppose you had a NSFW comment in your room, or wish to scroll an annoying gif off screen by e.g. 15 lines. You can run:
16:23 <jschauma> !clear 15
16:23 <jbot> /code ...............
16:23 <jbot> ..............
16:23 <jbot> .............
16:23 <jbot> ............
16:23 <jbot> ...........
16:23 <jbot> ..........
16:23 <jbot> .........
16:23 <jbot> ______
16:23 <jbot> < clear >
16:23 <jbot> -------
16:23 <jbot> \ ^__^
16:23 <jbot> \ (oo)\_______
16:23 <jbot> (__)\ )\/\
16:23 <jbot> ||----w |
16:23 <jbot> || ||
!cowsay <something> -- cowsay(1) something
16:25 <jschauma> !cowsay moo
16:25 <jbot> /code _____
16:25 <jbot> < moo >
16:25 <jbot> -----
16:25 <jbot> \ ^__^
16:25 <jbot> \ (oo)\_______
16:25 <jbot> (__)\ )\/\
16:25 <jbot> ||----w |
16:25 <jbot> || ||
!curses [<user>] -- check your curse count
16:26 <jschauma> !curses
16:26 <jbot> shit (2), fuck (1)
16:26 <jschauma> !curses lord
16:26 <jbot> Looks like lord has been behaving so
far.
!cve <cve-id> -- display vulnerability description
16:27 <jschauma> !cve CVE-2016-5385
16:27 <jbot> PHP through 7.0.8 does not attempt to address RFC 3875 section 4.1.18 namespace
conflicts and therefore does not protect applications from the presence of untrusted
client data in the HTTP_PROXY environment variable, which might allow remote
attackers to redirect an application's outbound HTTP traffic to an arbitrary proxy
server via a crafted Proxy header in an HTTP request, as demonstrated by (1) an
application that
16:27 <jbot> makes a getenv('HTTP_PROXY') call or (2) a CGI configuration of PHP, aka an "httpoxy"
issue.
16:27 <jbot> https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5385
!fml -- display an FML quote
Note: possibly NSFW.
16:28 <jschauma> !fml
16:28 <jbot> Today, I asked my mom why she drinks. She said she only drinks when she's depressed.
My step-dad said she only drinks on the weekend. Those are the days I'm at her house.
FML
!fortune -- print a random, hopefully interesting, adage
16:28 <jschauma> !fortune
16:28 <jbot> Denver, n.:
16:28 <jbot> A smallish city located just below the `O' in Colorado.
!help [all|<command>] -- show help
10:49 <jans> !help
10:49 <jbot> I know 32 commands.
10:49 <jbot> Use '!help all' to show all commands.
10:49 <jbot> Ask me about a specific command via '!help <cmd>'.
10:49 <jbot> If you find me annoyingly chatty, just '!toggle chatter'.
10:49 <jbot> To ask me to leave a channel, say '!leave'.
10:50 <jans> !help help
10:50 <jbot> !help [all|<command>] -- display this help
16:28 <jans> !help all
16:28 <jbot> These are commands I know:
16:28 <jbot> 8ball, asn, by, channels, clear, cowsay, curses, cve, fml, fortune,
help, host, info, insult, jira, leave, ping, quote, rfc,
room, seen, set, speb, stfu, tfln, throttle, tld, toggle, trivia, ud,
unset, user, vu, weather, wtf
!host <host> -- host lookup
Just like host(1).
16:29 <jschauma> !host www.yahoo.com
16:29 <jbot> www.yahoo.com is an alias for fd-fp3.wg1.b.yahoo.com.
16:29 <jbot> fd-fp3.wg1.b.yahoo.com has address 98.138.49.66
16:29 <jbot> fd-fp3.wg1.b.yahoo.com has IPv6 address 2001:4998:44:204::a8
!how <command> -- show how a command is implemented
11:38 <jschauma> !how tld
11:38 <jbot> whois -h whois.iana.org
!img <something> -- fetch a link to an image
Note: possibly NSFW
12:49 <jschauma> !img avocado
12:49 <jbot> http://www.buyfruit.com.au/images/P/iStock_000002972468Small_%28avocado_-_shepard%29__31894.jpg
!info <channel> -- display info about a channel
16:29 <jschauma> !info
16:29 <jbot> I was invited into #jtest by jans.
16:29 <jbot> These are the users I've seen in #jtest:
16:29 <jbot> jbot, jans
16:29 <jbot> Top 10 channel chatterers for #jtest:
16:29 <jbot> jans (69), jbot (2)
16:29 <jbot> These are the toggles for this channel:
16:29 <jbot> chatter => true, python => true, trivia => true
16:29 <jbot> This channel is currently unthrottled.
!insult <somebody> -- insult s
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
