forked from PluralFlux/PluralFlux
accidental error with memberHelper not allowing pf;member fixed
This commit is contained in:
@@ -25,6 +25,9 @@ const commandList = ['--help', 'new', 'remove', 'name', 'list', 'displayName', '
|
|||||||
* @throws {Error}
|
* @throws {Error}
|
||||||
*/
|
*/
|
||||||
mh.parseMemberCommand = async function (authorId, authorFull, args, attachmentUrl = null, attachmentExpiration = null) {
|
mh.parseMemberCommand = async function (authorId, authorFull, args, attachmentUrl = null, attachmentExpiration = null) {
|
||||||
|
if (!args[0]) {
|
||||||
|
return mh.getMemberCommandInfo();
|
||||||
|
}
|
||||||
const memberName = !commandList.includes(args[0]) ? args[0] : args[1];
|
const memberName = !commandList.includes(args[0]) ? args[0] : args[1];
|
||||||
|
|
||||||
// checks whether command is in list, otherwise assumes it's a name
|
// checks whether command is in list, otherwise assumes it's a name
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ describe('MemberHelper', () => {
|
|||||||
test.each([
|
test.each([
|
||||||
[['--help']],
|
[['--help']],
|
||||||
[['']],
|
[['']],
|
||||||
|
[[]]
|
||||||
])('%s calls getMemberCommandInfo and returns expected result', async (args) => {
|
])('%s calls getMemberCommandInfo and returns expected result', async (args) => {
|
||||||
// Act
|
// Act
|
||||||
return memberHelper.parseMemberCommand(authorId, authorFull, args).then((result) => {
|
return memberHelper.parseMemberCommand(authorId, authorFull, args).then((result) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user