-
Notifications
You must be signed in to change notification settings - Fork 8
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
[feature] FAQ bot add, list, and define #71
Conversation
Do you want to partition out the commands a bit to different PRs? Would be easier to review that way and incrementally upload to main bot without having to do massive rollbacks (if god forbid we had to) |
let details = dedent(`**${faq.term}**: ${faq.definition}`); | ||
|
||
if (addReferences) { | ||
details += dedent(` |
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.
maybe prettier do do \n instead of this
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.
agree
|
||
if (addId) { | ||
details += dedent(` | ||
ID: ${faq._id}`); |
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.
same as above comment
import addFaq from './subCommands/addFaq'; | ||
import client from '../../client'; | ||
import { commandHandler } from '../../utils'; | ||
// import deleteFaq from './subCommands/deleteFaq'; |
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.
please don't leave comments in the code.
import { commandHandler } from '../../utils'; | ||
// import deleteFaq from './subCommands/deleteFaq'; | ||
import defineFaq from './subCommands/defineFaq'; | ||
// import editFaq from './subCommands/editFaq'; |
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.
ditto
|
||
let newFaq = await Faq({ | ||
definition: args.slice(1).join(' '), | ||
term: args[0] |
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.
@brendacs think that we would need to create multi word terms? Some FAQs in my mind may definitely be more than one word (examples: functional programming, data structures)
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 agree, that was my thought from the beginning
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.
@nikgil what about simply using hyphens instead of spaces? Spaces are generally understood as carrying semantic within commands, so I think it's safer (for extensibility) to keep it to a "single-word".
E.g. function-programming
and data-structures
let allFaqs = '**All FAQs:**\n\n'; | ||
|
||
faqs.forEach( | ||
(faq) => (allFaqs += `${getFormattedFaq(faq, true, showIds)}\n\n`) |
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.
later problem is getting this paginated
This issue is stale because it has been open at least 120 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Any reason why Also, as a personal note, I think it'd be interesting to have aliases. For example:
|
Not scrapped per se as much as can be done in multiple PRs since they are pretty independent of each other |
Purpose of pull request
Related Issue: resolves #30
Pull request checklist
3/3 done
PR-specific checklist
++faq add
++faq list
++faq define
Responds to++faq delete
++faq list -i
Handles duplicates with++faq define
Testing instructions
++faq