Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added discordjs docs command #1164

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft

added discordjs docs command #1164

wants to merge 3 commits into from

Conversation

derpyxd
Copy link

@derpyxd derpyxd commented Sep 4, 2020

#Closes #508

@derpyxd derpyxd added type: feature New feature scope: commands New command(s) suggestion/addition labels Sep 4, 2020
@derpyxd derpyxd requested a review from a team as a code owner September 4, 2020 18:22
@derpyxd derpyxd requested review from pedrofracassi and removed request for pedrofracassi September 4, 2020 18:23
}

async run ({ channel }, query) {
const queryParams = new URLSearchParams({ src: 'stable', q: query })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if i dont want search in the stable branch?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to hop in and suggest using a flag like --branch to choose a branch.

module.exports = class Docs extends Command {
constructor (client) {
super({
name: 'docs',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be djsdocs and aliases like djdocs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I'd say use "discordjs" as the main name and have a few derivatives from it, like "djsdocs", etc. Never just "docs", because we'll surely have docs commands for other things in the future.

@almeidx almeidx changed the title added docs command added discordjs docs command Sep 6, 2020
Copy link
Member

@pedrofracassi pedrofracassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Real bad practice here. Don't just use an external service that returns an embed. Parse the JSDoc JSON from discord.js and create your own embed.

@almeidx
Copy link
Member

almeidx commented Sep 7, 2020

Real bad practice here. Don't just use an external service that returns an embed. Parse the JSDoc JSON from discord.js and create your own embed.

You can use this

@derpyxd
Copy link
Author

derpyxd commented Sep 7, 2020

Real bad practice here. Don't just use an external service that returns an embed. Parse the JSDoc JSON from discord.js and create your own embed.

You can use this

I know, I was using the API so I wouldn't have so much work to handle the query to do the search on documentation

@pedrofracassi
Copy link
Member

By using that API localization is nearly impossible, so we better parse the original JSON ourselves.

@derpyxd
Copy link
Author

derpyxd commented Sep 7, 2020

By using that API localization is nearly impossible, so we better parse the original JSON ourselves.

ok, i will remake this code and adaptating it to JSON documentation :)

@almeidx almeidx marked this pull request as draft September 9, 2020 13:36
@almeidx almeidx added the status: wip Work in progress label Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: commands New command(s) suggestion/addition status: wip Work in progress type: feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

discord.js docs search command
4 participants