mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
More Automod updates
This commit is contained in:
parent
e359fc46b2
commit
07da88b7cb
13 changed files with 88 additions and 28 deletions
|
@ -1,6 +1,9 @@
|
|||
import { User } from "eris";
|
||||
import { PluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { stripObjectToScalars } from "../../../utils";
|
||||
|
||||
export async function setAntiraidLevel(
|
||||
pluginData: PluginData<AutomodPluginType>,
|
||||
|
@ -10,9 +13,16 @@ export async function setAntiraidLevel(
|
|||
pluginData.state.cachedAntiraidLevel = newLevel;
|
||||
await pluginData.state.antiraidLevels.set(newLevel);
|
||||
|
||||
const logs = pluginData.getPlugin(LogsPlugin);
|
||||
|
||||
if (user) {
|
||||
// TODO: Log user action
|
||||
logs.log(LogType.SET_ANTIRAID_USER, {
|
||||
level: newLevel ?? "off",
|
||||
user: stripObjectToScalars(user),
|
||||
});
|
||||
} else {
|
||||
// TODO: Log automatic action
|
||||
logs.log(LogType.SET_ANTIRAID_AUTO, {
|
||||
level: newLevel ?? "off",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue