mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-07 11:07:19 +00:00
Added Discord attachment link reaction, fixed emoji configuration and moved util functions
This commit is contained in:
parent
a4c4b17a14
commit
592d037148
173 changed files with 1540 additions and 1170 deletions
|
@ -13,11 +13,12 @@ import escapeStringRegexp from "escape-string-regexp";
|
|||
import { ArgsFromSignatureOrArray, GuildPluginData } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { RegExpRunner, allowTimeout } from "../../RegExpRunner";
|
||||
import { getBaseUrl, sendErrorMessage } from "../../pluginUtils";
|
||||
import { getBaseUrl } from "../../pluginUtils";
|
||||
import { MINUTES, multiSorter, renderUserUsername, sorter, trimLines } from "../../utils";
|
||||
import { asyncFilter } from "../../utils/async";
|
||||
import { hasDiscordPermissions } from "../../utils/hasDiscordPermissions";
|
||||
import { InvalidRegexError, inputPatternToRegExp } from "../../validatorUtils";
|
||||
import { CommonPlugin } from "../Common/CommonPlugin";
|
||||
import { banSearchSignature } from "./commands/BanSearchCmd";
|
||||
import { searchCmdSignature } from "./commands/SearchCmd";
|
||||
import { getUserInfoEmbed } from "./functions/getUserInfoEmbed";
|
||||
|
@ -115,12 +116,12 @@ export async function displaySearch(
|
|||
}
|
||||
} catch (e) {
|
||||
if (e instanceof SearchError) {
|
||||
sendErrorMessage(pluginData, msg.channel, e.message);
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e instanceof InvalidRegexError) {
|
||||
sendErrorMessage(pluginData, msg.channel, e.message);
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -128,7 +129,7 @@ export async function displaySearch(
|
|||
}
|
||||
|
||||
if (searchResult.totalResults === 0) {
|
||||
sendErrorMessage(pluginData, msg.channel, "No results found");
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "No results found");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -259,12 +260,12 @@ export async function archiveSearch(
|
|||
}
|
||||
} catch (e) {
|
||||
if (e instanceof SearchError) {
|
||||
sendErrorMessage(pluginData, msg.channel, e.message);
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e instanceof InvalidRegexError) {
|
||||
sendErrorMessage(pluginData, msg.channel, e.message);
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -272,7 +273,7 @@ export async function archiveSearch(
|
|||
}
|
||||
|
||||
if (results.totalResults === 0) {
|
||||
sendErrorMessage(pluginData, msg.channel, "No results found");
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "No results found");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue