mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-07 11:07:19 +00:00
Fixes, refactoring and PR feedback
This commit is contained in:
parent
0be54912c4
commit
893a77d562
202 changed files with 1037 additions and 1069 deletions
|
@ -25,7 +25,6 @@ import {
|
|||
} from "../../utils";
|
||||
import { asyncFilter } from "../../utils/async";
|
||||
import { hasDiscordPermissions } from "../../utils/hasDiscordPermissions";
|
||||
import { CommonPlugin } from "../Common/CommonPlugin";
|
||||
import { banSearchSignature } from "./commands/BanSearchCmd";
|
||||
import { searchCmdSignature } from "./commands/SearchCmd";
|
||||
import { getUserInfoEmbed } from "./functions/getUserInfoEmbed";
|
||||
|
@ -123,12 +122,12 @@ export async function displaySearch(
|
|||
}
|
||||
} catch (e) {
|
||||
if (e instanceof SearchError) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
void pluginData.state.common.sendErrorMessage(msg, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e instanceof InvalidRegexError) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
void pluginData.state.common.sendErrorMessage(msg, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -136,7 +135,7 @@ export async function displaySearch(
|
|||
}
|
||||
|
||||
if (searchResult.totalResults === 0) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "No results found");
|
||||
void pluginData.state.common.sendErrorMessage(msg, "No results found");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -267,12 +266,12 @@ export async function archiveSearch(
|
|||
}
|
||||
} catch (e) {
|
||||
if (e instanceof SearchError) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
void pluginData.state.common.sendErrorMessage(msg, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e instanceof InvalidRegexError) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, e.message);
|
||||
void pluginData.state.common.sendErrorMessage(msg, e.message);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -280,7 +279,7 @@ export async function archiveSearch(
|
|||
}
|
||||
|
||||
if (results.totalResults === 0) {
|
||||
pluginData.getPlugin(CommonPlugin).sendErrorMessage(msg, "No results found");
|
||||
void pluginData.state.common.sendErrorMessage(msg, "No results found");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue