2020-07-05 15:59:15 +03:00
|
|
|
import { Member, Message, User } from "eris";
|
|
|
|
import moment from "moment-timezone";
|
|
|
|
import escapeStringRegexp from "escape-string-regexp";
|
2020-07-06 00:53:28 +03:00
|
|
|
import { isFullMessage, MINUTES, multiSorter, noop, sorter, trimLines } from "../../utils";
|
2020-07-06 01:51:48 +03:00
|
|
|
import { getBaseUrl, sendErrorMessage } from "../../pluginUtils";
|
2020-07-05 15:59:15 +03:00
|
|
|
import { PluginData } from "knub";
|
|
|
|
import { ArgsFromSignatureOrArray } from "knub/dist/commands/commandUtils";
|
2020-07-06 00:53:28 +03:00
|
|
|
import { searchCmdSignature } from "./commands/SearchCmd";
|
|
|
|
import { banSearchSignature } from "./commands/BanSearchCmd";
|
|
|
|
import { UtilityPluginType } from "./types";
|
|
|
|
import { refreshMembersIfNeeded } from "./refreshMembers";
|
2020-08-05 17:38:47 +03:00
|
|
|
import { getUserInfoEmbed } from "./functions/getUserInfoEmbed";
|
2020-08-10 00:39:07 +03:00
|
|
|
import { allowTimeout } from "../../RegExpRunner";
|
2020-08-10 01:31:32 +03:00
|
|
|
import { inputPatternToRegExp, InvalidRegexError } from "../../validatorUtils";
|
|
|
|
import { asyncFilter } from "../../utils/async";
|
2020-07-05 15:59:15 +03:00
|
|
|
|
|
|
|
const SEARCH_RESULTS_PER_PAGE = 15;
|
|
|
|
const SEARCH_ID_RESULTS_PER_PAGE = 50;
|
|
|
|
const SEARCH_EXPORT_LIMIT = 1_000_000;
|
|
|
|
|
|
|
|
export enum SearchType {
|
|
|
|
MemberSearch,
|
|
|
|
BanSearch,
|
|
|
|
}
|
|
|
|
|
2020-07-05 16:01:49 +03:00
|
|
|
class SearchError extends Error {}
|
2020-07-05 15:59:15 +03:00
|
|
|
|
|
|
|
type MemberSearchParams = ArgsFromSignatureOrArray<typeof searchCmdSignature>;
|
|
|
|
type BanSearchParams = ArgsFromSignatureOrArray<typeof banSearchSignature>;
|
|
|
|
|
|
|
|
export async function displaySearch(
|
|
|
|
pluginData: PluginData<UtilityPluginType>,
|
|
|
|
args: MemberSearchParams,
|
|
|
|
searchType: SearchType.MemberSearch,
|
|
|
|
msg: Message,
|
|
|
|
);
|
|
|
|
export async function displaySearch(
|
|
|
|
pluginData: PluginData<UtilityPluginType>,
|
|
|
|
args: BanSearchParams,
|
|
|
|
searchType: SearchType.BanSearch,
|
|
|
|
msg: Message,
|
|
|
|
);
|
|
|
|
export async function displaySearch(
|
|
|
|
pluginData: PluginData<UtilityPluginType>,
|
|
|
|
args: MemberSearchParams | BanSearchParams,
|
|
|
|
searchType: SearchType,
|
|
|
|
msg: Message,
|
|
|
|
) {
|
|
|
|
// If we're not exporting, load 1 page of search results at a time and allow the user to switch pages with reactions
|
|
|
|
let originalSearchMsg: Message = null;
|
|
|
|
let searching = false;
|
|
|
|
let currentPage = args.page || 1;
|
|
|
|
let hasReactions = false;
|
|
|
|
let clearReactionsFn = null;
|
|
|
|
let clearReactionsTimeout = null;
|
|
|
|
|
|
|
|
const perPage = args.ids ? SEARCH_ID_RESULTS_PER_PAGE : SEARCH_RESULTS_PER_PAGE;
|
|
|
|
|
|
|
|
const loadSearchPage = async page => {
|
|
|
|
if (searching) return;
|
|
|
|
searching = true;
|
|
|
|
|
|
|
|
// The initial message is created here, as well as edited to say "Searching..." on subsequent requests
|
|
|
|
// We don't "await" this so we can start loading the search results immediately instead of after the message has been created/edited
|
|
|
|
let searchMsgPromise: Promise<Message>;
|
|
|
|
if (originalSearchMsg) {
|
|
|
|
searchMsgPromise = originalSearchMsg.edit("Searching...");
|
|
|
|
} else {
|
|
|
|
searchMsgPromise = msg.channel.createMessage("Searching...");
|
|
|
|
searchMsgPromise.then(m => (originalSearchMsg = m));
|
|
|
|
}
|
|
|
|
|
|
|
|
let searchResult;
|
|
|
|
try {
|
|
|
|
switch (searchType) {
|
|
|
|
case SearchType.MemberSearch:
|
|
|
|
searchResult = await performMemberSearch(pluginData, args as MemberSearchParams, page, perPage);
|
|
|
|
break;
|
|
|
|
case SearchType.BanSearch:
|
|
|
|
searchResult = await performBanSearch(pluginData, args as BanSearchParams, page, perPage);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
if (e instanceof SearchError) {
|
|
|
|
return sendErrorMessage(pluginData, msg.channel, e.message);
|
|
|
|
}
|
|
|
|
|
2020-08-10 01:31:32 +03:00
|
|
|
if (e instanceof InvalidRegexError) {
|
|
|
|
return sendErrorMessage(pluginData, msg.channel, e.message);
|
|
|
|
}
|
|
|
|
|
2020-07-05 15:59:15 +03:00
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (searchResult.totalResults === 0) {
|
|
|
|
return sendErrorMessage(pluginData, msg.channel, "No results found");
|
|
|
|
}
|
|
|
|
|
|
|
|
const resultWord = searchResult.totalResults === 1 ? "matching member" : "matching members";
|
|
|
|
const headerText =
|
|
|
|
searchResult.totalResults > perPage
|
|
|
|
? trimLines(`
|
|
|
|
**Page ${searchResult.page}** (${searchResult.from}-${searchResult.to}) (total ${searchResult.totalResults})
|
|
|
|
`)
|
|
|
|
: `Found ${searchResult.totalResults} ${resultWord}`;
|
|
|
|
|
|
|
|
const resultList = args.ids
|
|
|
|
? formatSearchResultIdList(searchResult.results)
|
|
|
|
: formatSearchResultList(searchResult.results);
|
|
|
|
|
|
|
|
const result = trimLines(`
|
|
|
|
${headerText}
|
|
|
|
\`\`\`js
|
|
|
|
${resultList}
|
|
|
|
\`\`\`
|
|
|
|
`);
|
|
|
|
|
|
|
|
const searchMsg = await searchMsgPromise;
|
2020-07-29 02:21:22 +02:00
|
|
|
|
|
|
|
const cfg = pluginData.config.getForUser(msg.author);
|
|
|
|
if (cfg.info_on_single_result && searchResult.totalResults === 1) {
|
2020-08-05 17:38:47 +03:00
|
|
|
const embed = await getUserInfoEmbed(pluginData, searchResult.results[0].id, false);
|
|
|
|
if (embed) {
|
|
|
|
searchMsg.edit("Only one result:");
|
|
|
|
msg.channel.createMessage({ embed });
|
|
|
|
return;
|
|
|
|
}
|
2020-07-29 02:21:22 +02:00
|
|
|
}
|
|
|
|
|
2020-07-05 15:59:15 +03:00
|
|
|
searchMsg.edit(result);
|
|
|
|
|
|
|
|
// Set up pagination reactions if needed. The reactions are cleared after a timeout.
|
|
|
|
if (searchResult.totalResults > perPage) {
|
|
|
|
if (!hasReactions) {
|
|
|
|
hasReactions = true;
|
|
|
|
searchMsg.addReaction("⬅");
|
|
|
|
searchMsg.addReaction("➡");
|
|
|
|
searchMsg.addReaction("🔄");
|
|
|
|
|
|
|
|
const listenerFn = pluginData.events.on("messageReactionAdd", ({ args: { message: rMsg, emoji, userID } }) => {
|
|
|
|
if (rMsg.id !== searchMsg.id) return;
|
|
|
|
if (userID !== msg.author.id) return;
|
|
|
|
if (!["⬅", "➡", "🔄"].includes(emoji.name)) return;
|
|
|
|
|
|
|
|
if (emoji.name === "⬅" && currentPage > 1) {
|
|
|
|
loadSearchPage(currentPage - 1);
|
|
|
|
} else if (emoji.name === "➡" && currentPage < searchResult.lastPage) {
|
|
|
|
loadSearchPage(currentPage + 1);
|
|
|
|
} else if (emoji.name === "🔄") {
|
|
|
|
loadSearchPage(currentPage);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isFullMessage(rMsg)) {
|
|
|
|
rMsg.removeReaction(emoji.name, userID);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
clearReactionsFn = async () => {
|
|
|
|
searchMsg.removeReactions().catch(noop);
|
|
|
|
pluginData.events.off("messageReactionAdd", listenerFn);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
clearTimeout(clearReactionsTimeout);
|
|
|
|
clearReactionsTimeout = setTimeout(clearReactionsFn, 5 * MINUTES);
|
|
|
|
}
|
|
|
|
|
|
|
|
currentPage = searchResult.page;
|
|
|
|
searching = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
loadSearchPage(currentPage);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function archiveSearch(
|
|
|
|
pluginData: PluginData<UtilityPluginType>,
|
|
|
|
args: MemberSearchParams,
|
|
|
|
searchType: SearchType.MemberSearch,
|
|
|
|
msg: Message,
|
|
|
|
);
|
|
|
|
export async function archiveSearch(
|
|
|
|
pluginData: PluginData<UtilityPluginType>,
|
|
|
|
args: BanSearchParams,
|
|
|
|
searchType: SearchType.BanSearch,
|
|
|
|
msg: Message,
|
|
|
|
);
|
|
|
|
export async function archiveSearch(
|
|
|
|
pluginData: PluginData<UtilityPluginType>,
|
|
|
|
args: MemberSearchParams | BanSearchParams,
|
|
|
|
searchType: SearchType,
|
|
|
|
msg: Message,
|
|
|
|
) {
|
|
|
|
let results;
|
|
|
|
try {
|
|
|
|
switch (searchType) {
|
|
|
|
case SearchType.MemberSearch:
|
|
|
|
results = await performMemberSearch(pluginData, args as MemberSearchParams, 1, SEARCH_EXPORT_LIMIT);
|
|
|
|
break;
|
|
|
|
case SearchType.BanSearch:
|
|
|
|
results = await performBanSearch(pluginData, args as BanSearchParams, 1, SEARCH_EXPORT_LIMIT);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
if (e instanceof SearchError) {
|
|
|
|
return sendErrorMessage(pluginData, msg.channel, e.message);
|
|
|
|
}
|
|
|
|
|
2020-08-10 01:31:32 +03:00
|
|
|
if (e instanceof InvalidRegexError) {
|
|
|
|
return sendErrorMessage(pluginData, msg.channel, e.message);
|
|
|
|
}
|
|
|
|
|
2020-07-05 15:59:15 +03:00
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (results.totalResults === 0) {
|
|
|
|
return sendErrorMessage(pluginData, msg.channel, "No results found");
|
|
|
|
}
|
|
|
|
|
|
|
|
const resultList = args.ids ? formatSearchResultIdList(results.results) : formatSearchResultList(results.results);
|
|
|
|
|
|
|
|
const archiveId = await pluginData.state.archives.create(
|
|
|
|
trimLines(`
|
|
|
|
Search results (total ${results.totalResults}):
|
|
|
|
|
|
|
|
${resultList}
|
|
|
|
`),
|
2020-08-10 00:24:06 +03:00
|
|
|
moment.utc().add(1, "hour"),
|
2020-07-05 15:59:15 +03:00
|
|
|
);
|
|
|
|
|
2020-07-06 01:51:48 +03:00
|
|
|
const baseUrl = getBaseUrl(pluginData);
|
2020-07-05 15:59:15 +03:00
|
|
|
const url = await pluginData.state.archives.getUrl(baseUrl, archiveId);
|
|
|
|
|
2020-08-10 01:34:45 +03:00
|
|
|
await msg.channel.createMessage(`Exported search results: ${url}`);
|
2020-07-05 15:59:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
async function performMemberSearch(
|
|
|
|
pluginData: PluginData<UtilityPluginType>,
|
|
|
|
args: MemberSearchParams,
|
|
|
|
page = 1,
|
|
|
|
perPage = SEARCH_RESULTS_PER_PAGE,
|
|
|
|
): Promise<{ results: Member[]; totalResults: number; page: number; lastPage: number; from: number; to: number }> {
|
2020-08-10 01:34:45 +03:00
|
|
|
await refreshMembersIfNeeded(pluginData.guild);
|
2020-07-05 15:59:15 +03:00
|
|
|
|
|
|
|
let matchingMembers = Array.from(pluginData.guild.members.values());
|
|
|
|
|
|
|
|
if (args.role) {
|
|
|
|
const roleIds = args.role.split(",");
|
|
|
|
matchingMembers = matchingMembers.filter(member => {
|
|
|
|
for (const role of roleIds) {
|
|
|
|
if (!member.roles.includes(role)) return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args.voice) {
|
|
|
|
matchingMembers = matchingMembers.filter(m => m.voiceState.channelID != null);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args.bot) {
|
|
|
|
matchingMembers = matchingMembers.filter(m => m.bot);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args.query) {
|
|
|
|
let queryRegex: RegExp;
|
|
|
|
if (args.regex) {
|
2020-08-10 01:31:32 +03:00
|
|
|
const flags = args["case-sensitive"] ? "" : "i";
|
|
|
|
queryRegex = inputPatternToRegExp(args.query.trimStart());
|
|
|
|
queryRegex = new RegExp(queryRegex.source, flags);
|
2020-07-05 15:59:15 +03:00
|
|
|
} else {
|
|
|
|
queryRegex = new RegExp(escapeStringRegexp(args.query.trimStart()), args["case-sensitive"] ? "" : "i");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args["status-search"]) {
|
2020-08-10 01:31:32 +03:00
|
|
|
matchingMembers = await asyncFilter(matchingMembers, async member => {
|
2020-07-05 15:59:15 +03:00
|
|
|
if (member.game) {
|
2020-08-10 01:31:32 +03:00
|
|
|
if (
|
|
|
|
member.game.name &&
|
|
|
|
(await pluginData.state.regexRunner.exec(queryRegex, member.game.name).catch(allowTimeout))
|
|
|
|
) {
|
2020-07-05 15:59:15 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-08-10 00:39:07 +03:00
|
|
|
if (
|
|
|
|
member.game.state &&
|
2020-08-10 01:31:32 +03:00
|
|
|
(await pluginData.state.regexRunner.exec(queryRegex, member.game.state).catch(allowTimeout))
|
2020-08-10 00:39:07 +03:00
|
|
|
) {
|
2020-07-05 15:59:15 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-08-10 00:39:07 +03:00
|
|
|
if (
|
|
|
|
member.game.details &&
|
2020-08-10 01:31:32 +03:00
|
|
|
(await pluginData.state.regexRunner.exec(queryRegex, member.game.details).catch(allowTimeout))
|
2020-08-10 00:39:07 +03:00
|
|
|
) {
|
2020-07-05 15:59:15 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (member.game.assets) {
|
2020-08-10 00:39:07 +03:00
|
|
|
if (
|
|
|
|
member.game.assets.small_text &&
|
2020-08-10 01:31:32 +03:00
|
|
|
(await pluginData.state.regexRunner.exec(queryRegex, member.game.assets.small_text).catch(allowTimeout))
|
2020-08-10 00:39:07 +03:00
|
|
|
) {
|
2020-07-05 15:59:15 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-08-10 00:39:07 +03:00
|
|
|
if (
|
|
|
|
member.game.assets.large_text &&
|
2020-08-10 01:31:32 +03:00
|
|
|
(await pluginData.state.regexRunner.exec(queryRegex, member.game.assets.large_text).catch(allowTimeout))
|
2020-08-10 00:39:07 +03:00
|
|
|
) {
|
2020-07-05 15:59:15 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-10 00:39:07 +03:00
|
|
|
if (
|
|
|
|
member.game.emoji &&
|
2020-08-10 01:31:32 +03:00
|
|
|
(await pluginData.state.regexRunner.exec(queryRegex, member.game.emoji.name).catch(allowTimeout))
|
2020-08-10 00:39:07 +03:00
|
|
|
) {
|
2020-07-05 15:59:15 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
} else {
|
2020-08-10 01:31:32 +03:00
|
|
|
matchingMembers = await asyncFilter(matchingMembers, async member => {
|
2020-08-10 01:34:45 +03:00
|
|
|
if (member.nick && (await pluginData.state.regexRunner.exec(queryRegex, member.nick).catch(allowTimeout))) {
|
2020-08-10 01:31:32 +03:00
|
|
|
return true;
|
2020-08-10 01:34:45 +03:00
|
|
|
}
|
2020-07-05 15:59:15 +03:00
|
|
|
|
|
|
|
const fullUsername = `${member.user.username}#${member.user.discriminator}`;
|
2020-08-10 01:31:32 +03:00
|
|
|
if (await pluginData.state.regexRunner.exec(queryRegex, fullUsername).catch(allowTimeout)) return true;
|
2020-07-05 15:59:15 +03:00
|
|
|
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const [, sortDir, sortBy] = args.sort ? args.sort.match(/^(-?)(.*)$/) : [null, "ASC", "name"];
|
|
|
|
const realSortDir = sortDir === "-" ? "DESC" : "ASC";
|
|
|
|
|
|
|
|
if (sortBy === "id") {
|
|
|
|
matchingMembers.sort(sorter(m => BigInt(m.id), realSortDir));
|
|
|
|
} else {
|
|
|
|
matchingMembers.sort(
|
|
|
|
multiSorter([
|
|
|
|
[m => m.username.toLowerCase(), realSortDir],
|
|
|
|
[m => m.discriminator, realSortDir],
|
|
|
|
]),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
const lastPage = Math.max(1, Math.ceil(matchingMembers.length / perPage));
|
|
|
|
page = Math.min(lastPage, Math.max(1, page));
|
|
|
|
|
|
|
|
const from = (page - 1) * perPage;
|
|
|
|
const to = Math.min(from + perPage, matchingMembers.length);
|
|
|
|
|
|
|
|
const pageMembers = matchingMembers.slice(from, to);
|
|
|
|
|
|
|
|
return {
|
|
|
|
results: pageMembers,
|
|
|
|
totalResults: matchingMembers.length,
|
|
|
|
page,
|
|
|
|
lastPage,
|
|
|
|
from: from + 1,
|
|
|
|
to,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
async function performBanSearch(
|
|
|
|
pluginData: PluginData<UtilityPluginType>,
|
|
|
|
args: BanSearchParams,
|
|
|
|
page = 1,
|
|
|
|
perPage = SEARCH_RESULTS_PER_PAGE,
|
|
|
|
): Promise<{ results: User[]; totalResults: number; page: number; lastPage: number; from: number; to: number }> {
|
|
|
|
let matchingBans = (await pluginData.guild.getBans()).map(x => x.user);
|
|
|
|
|
|
|
|
if (args.query) {
|
|
|
|
let queryRegex: RegExp;
|
|
|
|
if (args.regex) {
|
2020-08-10 01:31:32 +03:00
|
|
|
const flags = args["case-sensitive"] ? "" : "i";
|
|
|
|
queryRegex = inputPatternToRegExp(args.query.trimStart());
|
|
|
|
queryRegex = new RegExp(queryRegex.source, flags);
|
2020-07-05 15:59:15 +03:00
|
|
|
} else {
|
|
|
|
queryRegex = new RegExp(escapeStringRegexp(args.query.trimStart()), args["case-sensitive"] ? "" : "i");
|
|
|
|
}
|
|
|
|
|
2020-08-10 01:31:32 +03:00
|
|
|
matchingBans = await asyncFilter(matchingBans, async user => {
|
2020-07-05 15:59:15 +03:00
|
|
|
const fullUsername = `${user.username}#${user.discriminator}`;
|
2020-08-10 01:31:32 +03:00
|
|
|
if (await pluginData.state.regexRunner.exec(queryRegex, fullUsername).catch(allowTimeout)) return true;
|
|
|
|
return false;
|
2020-07-05 15:59:15 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const [, sortDir, sortBy] = args.sort ? args.sort.match(/^(-?)(.*)$/) : [null, "ASC", "name"];
|
|
|
|
const realSortDir = sortDir === "-" ? "DESC" : "ASC";
|
|
|
|
|
|
|
|
if (sortBy === "id") {
|
|
|
|
matchingBans.sort(sorter(m => BigInt(m.id), realSortDir));
|
|
|
|
} else {
|
|
|
|
matchingBans.sort(
|
|
|
|
multiSorter([
|
|
|
|
[m => m.username.toLowerCase(), realSortDir],
|
|
|
|
[m => m.discriminator, realSortDir],
|
|
|
|
]),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
const lastPage = Math.max(1, Math.ceil(matchingBans.length / perPage));
|
|
|
|
page = Math.min(lastPage, Math.max(1, page));
|
|
|
|
|
|
|
|
const from = (page - 1) * perPage;
|
|
|
|
const to = Math.min(from + perPage, matchingBans.length);
|
|
|
|
|
|
|
|
const pageMembers = matchingBans.slice(from, to);
|
|
|
|
|
|
|
|
return {
|
|
|
|
results: pageMembers,
|
|
|
|
totalResults: matchingBans.length,
|
|
|
|
page,
|
|
|
|
lastPage,
|
|
|
|
from: from + 1,
|
|
|
|
to,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
function formatSearchResultList(members: Array<Member | User>): string {
|
|
|
|
const longestId = members.reduce((longest, member) => Math.max(longest, member.id.length), 0);
|
|
|
|
const lines = members.map(member => {
|
|
|
|
const paddedId = member.id.padEnd(longestId, " ");
|
|
|
|
let line;
|
|
|
|
if (member instanceof Member) {
|
|
|
|
line = `${paddedId} ${member.user.username}#${member.user.discriminator}`;
|
|
|
|
if (member.nick) line += ` (${member.nick})`;
|
|
|
|
} else {
|
|
|
|
line = `${paddedId} ${member.username}#${member.discriminator}`;
|
|
|
|
}
|
|
|
|
return line;
|
|
|
|
});
|
|
|
|
return lines.join("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
function formatSearchResultIdList(members: Array<Member | User>): string {
|
|
|
|
return members.map(m => m.id).join(" ");
|
|
|
|
}
|