Combine Knub's type helpers with Zeppelin's, continue Utility plugin port

This commit is contained in:
Dragory 2020-07-06 01:51:48 +03:00
parent b338351e37
commit 9f059f33af
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
13 changed files with 533 additions and 13 deletions

View file

@ -3,7 +3,7 @@ import moment from "moment-timezone";
import escapeStringRegexp from "escape-string-regexp";
import safeRegex from "safe-regex";
import { isFullMessage, MINUTES, multiSorter, noop, sorter, trimLines } from "../../utils";
import { sendErrorMessage } from "../../pluginUtils";
import { getBaseUrl, sendErrorMessage } from "../../pluginUtils";
import { PluginData } from "knub";
import { ArgsFromSignatureOrArray } from "knub/dist/commands/commandUtils";
import { searchCmdSignature } from "./commands/SearchCmd";
@ -205,7 +205,7 @@ export async function archiveSearch(
moment().add(1, "hour"),
);
const baseUrl = (pluginData.getKnubInstance().getGlobalConfig() as any).url; // FIXME: No any cast
const baseUrl = getBaseUrl(pluginData);
const url = await pluginData.state.archives.getUrl(baseUrl, archiveId);
msg.channel.createMessage(`Exported search results: ${url}`);