mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-14 20:15:28 +10:00
move list --help check to parseMemberCommand
This commit is contained in:
@@ -42,6 +42,9 @@ mh.parseMemberCommand = async function(authorId, authorFull, args, attachmentUrl
|
|||||||
case 'propic':
|
case 'propic':
|
||||||
return enums.help.PROPIC;
|
return enums.help.PROPIC;
|
||||||
case 'list':
|
case 'list':
|
||||||
|
if (args[1] && args[1] === "--help") {
|
||||||
|
return enums.help.LIST;
|
||||||
|
}
|
||||||
return await mh.getAllMembersInfo(authorId, authorFull).catch((e) =>{throw e});
|
return await mh.getAllMembersInfo(authorId, authorFull).catch((e) =>{throw e});
|
||||||
case '':
|
case '':
|
||||||
return enums.help.MEMBER;
|
return enums.help.MEMBER;
|
||||||
@@ -366,9 +369,6 @@ mh.getMemberInfo = async function (authorId, memberName) {
|
|||||||
* @throws {Error} When there are no members for an author.
|
* @throws {Error} When there are no members for an author.
|
||||||
*/
|
*/
|
||||||
mh.getAllMembersInfo = async function(authorId, authorName) {
|
mh.getAllMembersInfo = async function(authorId, authorName) {
|
||||||
if (args[1] && args[1] === "--help") {
|
|
||||||
return enums.help.LIST;
|
|
||||||
}
|
|
||||||
const members = await mh.getMembersByAuthor(authorId);
|
const members = await mh.getMembersByAuthor(authorId);
|
||||||
if (members == null) throw Error(enums.err.USER_NO_MEMBERS);
|
if (members == null) throw Error(enums.err.USER_NO_MEMBERS);
|
||||||
const fields = [...members.entries()].map(([name, member]) => ({
|
const fields = [...members.entries()].map(([name, member]) => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user