项目作者: ljosberinn

项目描述 :
Discord bot for web development
高级语言: TypeScript
项目地址: git://github.com/ljosberinn/webdev-support-bot.git
创建时间: 2019-11-29T14:31:52Z
项目社区:https://github.com/ljosberinn/webdev-support-bot

开源协议:MIT License

下载


Webdev Support Bot

dependencies
devdependencies



Bot providing multiple commands to query common sites used during development or helping people on Discord.

Supports

!github via GitHub API,

!composer via packagist API,

!npm via unofficial npmjs.com API,

!mdn via parsing Mozilla Developer Network,

!caniuse via unofficial caniuse API and @mdn/browser-combat-data,

!bundlephobia via unofficial bundlephobia API,

!jquery as explanation on why not to use jquery,

!php via parsing official PHP Docs.

Usage / TLDR

  1. # tag it in discord to receive general help
  2. @bot --help
  3. # provides an example each
  4. !mdn --help
  5. !caniuse --help
  6. !composer --help
  7. !npm --help
  8. !github --help
  9. !bundlephobia --help
  1. # queries MDN with <term>
  2. !mdn <term>
  1. # queries caniuse with <term>
  2. !caniuse <term>
  1. # queries packagist with <package>
  2. !composer <package>
  1. # queries npm with <package>
  2. !npm <package>
  1. # queries github with <term>
  2. !github <term>
  1. # queries bundlephobia with <term>
  2. !bundlephobia <term>
  • single-result queries will directly show the result
  • reacting with a number will filter the result
  • reacting with the red or black x will remove the request

Description

By default, shows the first ten results of any given query, unless only one result was found.

Reacting with a number corresponding to the list entry will filter the list and edit the original message, providing more specific information.

Add to your server by…

…accessing this link.

Demo



Development

  1. git clone https://github.com/ljosberinn/webdev-support-bot/
  2. cd webdev-support-bot
  3. cp .env.example .env # and enter a token
  4. yarn install # or npm install
  5. code .
  6. yarn dev # or npm dev
  7. # or be fancy with a one-liner
  8. git clone https://github.com/ljosberinn/webdev-support-bot/ && cd webdev-support-bot && cp .env.example .env && yarn install && code . && yarn dev

Environment variables

In development, you generally want to take the .env.example and rename it to .env. You also shouldn’t commit your .env file. If you make any changes to the environment variables, you should update .env.example. accordingly.

Running tests:

  1. $ npm test

Found a bug/want to contribute?

Please head over to GitHub.