mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-16 17:45:28 +10:00
desperately trying to make error handling work
This commit is contained in:
@@ -14,8 +14,8 @@ const commandList = ['--help', 'add', 'remove', 'name', 'listall', 'displayName'
|
||||
*
|
||||
* @param {User} author - The id of the message author
|
||||
* @param {string[]} args - The message arguments
|
||||
* @param {string | null} attachmentUrl - The message attachments
|
||||
* @returns {Promise<string> | Promise <EmbedBuilder>} A message, or an information embed.
|
||||
* @param {string | null} attachmentUrl - The message attachment url.
|
||||
* @returns {Promise<string> | Promise <EmbedBuilder>} A message, or an informational embed.
|
||||
*/
|
||||
mh.parseMemberCommand = async function(author, args, attachmentUrl){
|
||||
const authorId = author.id;
|
||||
|
||||
@@ -42,10 +42,10 @@ msgh.parseProxyTags = async function (authorId, attachment, content){
|
||||
const members = await memberHelper.getMembersByAuthor(authorId);
|
||||
|
||||
const proxyMessage = {}
|
||||
members.forEach(member => {
|
||||
if (content.length <= member.proxy.length && !attachment) throw new Error(enums.err.NO_MESSAGE_SENT_WITH_PROXY);
|
||||
members.filter(member => member.proxy).forEach(member => {
|
||||
const splitProxy = member.proxy.split("text");
|
||||
if(content.startsWith(splitProxy[0]) && content.endsWith(splitProxy[1])) {
|
||||
if (content.length <= member.proxy.length && !attachment) throw new Error(enums.err.NO_MESSAGE_SENT_WITH_PROXY);
|
||||
proxyMessage.proxy = member.proxy;
|
||||
proxyMessage.message = content.slice(member.proxy.length).trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user