mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-11 04:45:02 +00:00
Use RegExpRunner in !search and !bansearch
This commit is contained in:
parent
c67a1df11d
commit
bcfaf1fee3
3 changed files with 34 additions and 18 deletions
|
@ -32,6 +32,7 @@ import { ChannelInfoCmd } from "./commands/ChannelInfoCmd";
|
|||
import { MessageInfoCmd } from "./commands/MessageInfoCmd";
|
||||
import { InfoCmd } from "./commands/InfoCmd";
|
||||
import { SnowflakeInfoCmd } from "./commands/SnowflakeInfoCmd";
|
||||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||
|
||||
const defaultOptions: PluginOptions<UtilityPluginType> = {
|
||||
config: {
|
||||
|
@ -139,6 +140,8 @@ export const UtilityPlugin = zeppelinPlugin<UtilityPluginType>()("utility", {
|
|||
state.archives = GuildArchives.getGuildInstance(guild.id);
|
||||
state.supporters = new Supporters();
|
||||
|
||||
state.regexRunner = getRegExpRunner(`guild-${pluginData.guild.id}`);
|
||||
|
||||
state.lastReload = Date.now();
|
||||
|
||||
if (activeReloads.has(guild.id)) {
|
||||
|
@ -146,4 +149,8 @@ export const UtilityPlugin = zeppelinPlugin<UtilityPluginType>()("utility", {
|
|||
activeReloads.delete(guild.id);
|
||||
}
|
||||
},
|
||||
|
||||
onUnload(pluginData) {
|
||||
discardRegExpRunner(`guild-${pluginData.guild.id}`);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue