3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-15 06:05:03 +00:00
zeppelin/backend/src/plugins/Logs/logFunctions/logRoleCreate.ts
Dragory 45e3fe2ef0
chore: esm imports
This will make merging this into 'next' much easier.
2024-08-11 21:58:52 +03:00

22 lines
697 B
TypeScript

import { Role } from "discord.js";
import { GuildPluginData } from "knub";
import { LogType } from "../../../data/LogType.js";
import { createTypedTemplateSafeValueContainer } from "../../../templateFormatter.js";
import { roleToTemplateSafeRole } from "../../../utils/templateSafeObjects.js";
import { LogsPluginType } from "../types.js";
import { log } from "../util/log.js";
interface LogRoleCreateData {
role: Role;
}
export function logRoleCreate(pluginData: GuildPluginData<LogsPluginType>, data: LogRoleCreateData) {
return log(
pluginData,
LogType.ROLE_CREATE,
createTypedTemplateSafeValueContainer({
role: roleToTemplateSafeRole(data.role),
}),
{},
);
}