mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
More Automod updates
This commit is contained in:
parent
e359fc46b2
commit
07da88b7cb
13 changed files with 88 additions and 28 deletions
|
@ -17,6 +17,8 @@ import { LogsChannelCreateEvt, LogsChannelDeleteEvt } from "./events/LogsChannel
|
|||
import { LogsRoleCreateEvt, LogsRoleDeleteEvt } from "./events/LogsRoleModifyEvts";
|
||||
import { LogsVoiceJoinEvt, LogsVoiceLeaveEvt, LogsVoiceSwitchEvt } from "./events/LogsVoiceChannelEvts";
|
||||
import { log } from "./util/log";
|
||||
import { LogType } from "../../data/LogType";
|
||||
import { getLogMessage } from "./util/getLogMessage";
|
||||
|
||||
const defaultOptions: PluginOptions<LogsPluginType> = {
|
||||
config: {
|
||||
|
@ -58,6 +60,20 @@ export const LogsPlugin = zeppelinPlugin<LogsPluginType>()("logs", {
|
|||
LogsVoiceSwitchEvt,
|
||||
],
|
||||
|
||||
public: {
|
||||
log(pluginData) {
|
||||
return (type: LogType, data: any) => {
|
||||
return log(pluginData, type, data);
|
||||
};
|
||||
},
|
||||
|
||||
getLogMessage(pluginData) {
|
||||
return (type: LogType, data: any) => {
|
||||
return getLogMessage(pluginData, type, data);
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
onLoad(pluginData) {
|
||||
const { state, guild } = pluginData;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import { renderTemplate, TemplateParseError } from "src/templateFormatter";
|
|||
import { logger } from "src/logger";
|
||||
import moment from "moment-timezone";
|
||||
|
||||
export async function getLogMessage(pluginData: PluginData<LogsPluginType>, type, data): Promise<string> {
|
||||
export async function getLogMessage(pluginData: PluginData<LogsPluginType>, type: LogType, data: any): Promise<string> {
|
||||
const config = pluginData.config.get();
|
||||
const format = config.format[LogType[type]] || "";
|
||||
if (format === "") return;
|
||||
|
|
|
@ -5,7 +5,7 @@ import { TextChannel } from "eris";
|
|||
import { createChunkedMessage, noop } from "src/utils";
|
||||
import { getLogMessage } from "./getLogMessage";
|
||||
|
||||
export async function log(pluginData: PluginData<LogsPluginType>, type, data) {
|
||||
export async function log(pluginData: PluginData<LogsPluginType>, type: LogType, data: any) {
|
||||
const logChannels: TLogChannelMap = pluginData.config.get().channels;
|
||||
const typeStr = LogType[type];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue