za419 / CadenceBot

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

Implement core command aliasing #80

Closed za419 closed 3 years ago

za419 commented 3 years ago

Core commands (those listed in config.commands) may now be arbitrarily aliased to support multiple available forms.

Demo of the two added aliases: image

za419 commented 3 years ago

I will merge this into dev-master after it merges into master; As this is not part of ongoing development of detailed helptext, and as I have tested this to my satisfaction, I am willing to skip the staging branch and send this directly to the rolling-release branch.

Complain now if you don't like me doing this.

za419 commented 3 years ago

So "play" can replace "request" in the circumstance pertaining to picking a particular song, or just in general?

This is an interesting question, as phrased.

Fully spec compliant answer: As of merging this pull request, any message that starts with "Cadence play " from a non-banned user will be internally converted to instead start with "Cadence request " (or whatever string is specified in override config as the trigger for request) - Thus, it will be recognized as a canonical request by the command process flow, and will fire off a normal request.

More specific answer... It depends on what you mean by 'in general'. Obviously the short message 'Cadence play' will not trigger a request flow - It will trigger a normal play command. Nor will a command like 'Cadence echo play' produce the response "request".

However, "Cadence play " now acts as an alternate trigger phrase for request - So any functionality provided by "Cadence request " as of 16f613e will be provided by either "Cadence request " or "Cadence play " following this merge. This is demonstrated in the screenshot in the PR description - "Cadence play " is triggering both syntaxes for a request (one-step and by-index).