za419 / CadenceBot

A Discord bot for Cadence Radio
MIT License
2 stars 1 forks source link

Add detailed helptext for the stop command #69

Open za419 opened 3 years ago

za419 commented 3 years ago

Add an entry into default-config.json under helpTopics. The key should probably be 'stop', and the description should describe how one can use the command and how it will behave from a user perspective.

za419 commented 1 year ago

Better instructions, since @ErikAlmaguer is extremely new to the project and to team development.

This task is part of the detailed-helptext project, which is currently occupying dev-master due to engineering constraints which pushed this out on the roadmap to overlap with v5 integration - so there will be some merging required.

Further references to code and line numbers will be done off the currently non-working dev-master, at commit b881be1f6635cb015fa8e18a67c1eb2a059d0f8e.

The first step will of course be to make a branch off dev-master, named something like detailed-helptext-stop (whatever you want really, it's just useful to have names that mean something related to the purpose of the branch). You'll work on this branch, and eventually submit a Pull Request (PR) to merge that branch into dev-master to render your changes an "official" part of CadenceBot mainline (eventually, once dev-master gets updated to match current master, the CadenceBot-dev instance you've seen will be moved over to run dev-master in accordance with my official software development process as documented in the README.

Then, you can use several resources to try and gain an understanding of the stop command (it's very simple, so I don't anticipate any trouble). Lines 2 through 40 of default-config.json include some configuration of the core commands, among which is stop. Based on that structure you could probably find where its behavior is defined in bot.js, but to short-circuit that for you the line which recognizes whether a message is triggering the command is 684. This task is partially intended as a "warm-up", so part of the objective here is for you to familiarize yourself with the project and how things work behind the curtain.
If you have any problems with that, feel free to reach out for help and I'll give you a hand, but I doubt you'll need it.

Once you feel you properly understand the behavior of the command, you can see between configuration on lines 53 and 94 of default-config.json of existing detailed helptext, and if you'd like (though it's a bit less direct) the implementation of the command that converts that configuration data into a message to be sent to the user in bot.js between lines 736 and 865 how detailed helptext is written. The deliverable for this issue is another block in default-config.json, like the ones for help or nowplaying, for stop.

Unfortunately, due to the aforementioned v5 situation, we don't really have a great way to run and validate this - Normally, I'd ask that you at least test your new stuff and that it doesn't break anything else before putting our a pull request, but circumstances given, just do your best and when you think it's done, put out a pull request and I'll give you feedback including any results of an improvised test I'll put together on my own.

Short version:

  1. Make a new branch based on dev-master for your work.
  2. Familiarize yourself with the stop command, by interacting with the bot on Discord and reading the relevant sections of default-config.json and bot.js
  3. See how to write detailed helptexts primarily based on the relevant section of default-config.json and if necessary in bot.js
  4. Write your own detailed helptext section for the stop command, and commit it onto your branch.
  5. Open a PR for that branch here on GitHub.
  6. We'll work together to get that PR to a state ready to merge, then get it into dev-master.

If you have any questions, or if you have any trouble with any of this, please feel free to reach out to me or to anyone else on the team.

And, of course, welcome aboard!