-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
base: dev
Are you sure you want to change the base?
Conversation
src/commands/utility/docs.js
Outdated
} | ||
|
||
async run ({ channel }, query) { | ||
const queryParams = new URLSearchParams({ src: 'stable', q: query }) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
src/commands/utility/docs.js
Outdated
module.exports = class Docs extends Command { | ||
constructor (client) { | ||
super({ | ||
name: 'docs', |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
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 |
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 :) |
#Closes #508