GithubHelp home page GithubHelp logo

discord.js-docs's Introduction

discord.js docs

A parser and wrapper for the discord.js docs.

Usage

Doc

const Doc = require('discord.js-docs')

Warning: all methods will return null in case they somehow fail to resolve what you're looking for.
Will probably have them throw an error in the future... maybe..

Doc.fetch(project, branch[, options])

Fetches and parses the docs for the given project and branch.
Possible values for project: main, commando, rpc.
branch can be any branch name from the respective repositories.
Once a documentation is fetched it will be cached. Use options.force to avoid this behavior.

Params:

name type required
project string yes
branch string yes
options object no

Returns: Promise<Doc?>

const doc = await Doc.fetch('main', 'master')
const doc = await Doc.fetch('main', 'master', { force: true })

Doc#get(parent[, child1[ ...[, childN]]])

Gets documention for one element. Multiple properties/methods can be chained. Params:

name type required
parent string yes
...children string no

Returns: DocElement?

doc.get('message')
doc.get('message', 'guild')
doc.get('message', 'guild', 'members')

Doc#search(query)

Searches the documentation using fuzzy search for the given query and returns top 10 hits.

Params:

name type required
query string yes

Returns: Array<DocElement>?

Doc#resolveEmbed(query)

Tries to resolve the query into a DocElement using Doc#get. The search terms are expected to be separated by # or ., example: message#pin. If an element cannot be resolved, falls back to Doc#search. The result is then formatted into an object representing a Discord embed which can be sent directly to a Discord channel.

Params:

name type required
query string yes

Returns: object?

DocElement

Cba documenting pls help

discord.js-docs's People

Contributors

teeseal avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.