3
0
Fork 0
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:
Dragory 2020-08-10 00:39:07 +03:00
parent c67a1df11d
commit bcfaf1fee3
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
3 changed files with 34 additions and 18 deletions

View file

@ -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}`);
},
});