Skip to content
devdocs.io + cheat.sh discord bot
Branch: master
Clone or download
Pull request Compare This branch is 84 commits behind autobots-rocks:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.make @ e0befcf
manifests
src
.env.sample
.gitignore
.gitlab-ci.yml
.gitmodules
Dockerfile
Makefile
README.md
logo.png
package-lock.json
package.json
tsconfig.json

README.md

logo.png

devdocs.io + cheat.sh discord bot

Queries devdocs.io json schema for names via !js strict_mode etc. This bot comes with a simple monitoring endpoint for monitoring the bot being up (used with kubernetes). This bot uses the docsbot role for users to be able to query.

Commands

Command Description
#update <language> Downloads a language pack from devdocs.io.
#list Lists downloaded language packs.
#terms <language> Lists terms searchable by language pack.
#<language> <term> Displays documentation for a language + term.
#cheat <command> Displays documentation from cheat.sh for a command.

Installing

You need to npm install and cp .env.sample .env updating your bot token in the .env file then npm run build.

git clone https://github.com/autobots-rocks/autobot-docsbot
cd autobot-docsbot
cp .env.sample .env

Building

npm run build

Starting

npm run start

± |master S:395 U:390 ?:598 ✗| → npm run start

> @autobots/autobot-docsbot@1.0.0 start /Users/yomateod/workspace/work/autobots/autobot-docsbot
> node dist/main.js

[Nest] 11223   - 06/02/2019, 2:01 PM   [NestFactory] Starting Nest application...
Sun Jun 02 2019 14:01:52 GMT-0500 (Central Daylight Time): Logging into discord
[Nest] 11223   - 06/02/2019, 2:01 PM   [InstanceLoader] AppModule dependencies initialized +494ms
[Nest] 11223   - 06/02/2019, 2:01 PM   [InstanceLoader] MonitoringModule dependencies initialized +0ms
[Nest] 11223   - 06/02/2019, 2:01 PM   [RoutesResolver] MonitoringController {/monitoring}: +4ms
[Nest] 11223   - 06/02/2019, 2:01 PM   [RouterExplorer] Mapped {/is_alive, GET} route +2ms
[Nest] 11223   - 06/02/2019, 2:01 PM   [NestApplication] Nest application successfully started +2ms
Sun Jun 02 2019 14:01:52 GMT-0500 (Central Daylight Time): Bootstrapping /Users/yomateod/workspace/work/autobots/autobot-docsbot/node_modules/@autobot/module-docsbot
Sun Jun 02 2019 14:01:52 GMT-0500 (Central Daylight Time): Command Registered: !js (!js <search term>)
Sun Jun 02 2019 14:01:52 GMT-0500 (Central Daylight Time): Bot Started
Sun Jun 02 2019 14:01:53 GMT-0500 (Central Daylight Time): Connected to discord

Monitoring

The monitoring endpoint is available at http://localhost:8080/monitoring/is_alive.

Docker

This bot comes with its own Dockerfile.

Building

docker build -t docsbot .

Running

docker run -d -p8080:8080 --name docsbot docsbot

Viewing Logs

 docker logs -f docsbot

Stopping

 docker rm -f docsbot
You can’t perform that action at this time.