Automod work
This commit is contained in:
parent
140ba84544
commit
f657b169df
32 changed files with 1099 additions and 5 deletions
|
@ -0,0 +1,20 @@
|
|||
import { PluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { RecentActionType } from "../constants";
|
||||
|
||||
export function getMatchingRecentActions(
|
||||
pluginData: PluginData<AutomodPluginType>,
|
||||
type: RecentActionType,
|
||||
identifier: string | null,
|
||||
since: number,
|
||||
to: number,
|
||||
) {
|
||||
return pluginData.state.recentActions.filter(action => {
|
||||
return (
|
||||
action.type === type &&
|
||||
(!identifier || action.identifier === identifier) &&
|
||||
action.context.timestamp >= since &&
|
||||
action.context.timestamp <= to
|
||||
);
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue