mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
Fix logAutomodAction error if Automod context doesn't include a user
This commit is contained in:
parent
204a8619ae
commit
3c8355babf
2 changed files with 5 additions and 5 deletions
|
@ -8,7 +8,7 @@ import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
|||
|
||||
interface LogAutomodActionData {
|
||||
rule: string;
|
||||
user: User;
|
||||
user?: User | null;
|
||||
users: User[];
|
||||
actionsTaken: string;
|
||||
matchSummary: string;
|
||||
|
@ -20,14 +20,14 @@ export function logAutomodAction(pluginData: GuildPluginData<LogsPluginType>, da
|
|||
LogType.AUTOMOD_ACTION,
|
||||
createTypedTemplateSafeValueContainer({
|
||||
rule: data.rule,
|
||||
user: userToTemplateSafeUser(data.user),
|
||||
user: data.user ? userToTemplateSafeUser(data.user) : null,
|
||||
users: data.users.map(user => userToTemplateSafeUser(user)),
|
||||
actionsTaken: data.actionsTaken,
|
||||
matchSummary: data.matchSummary ?? "",
|
||||
}),
|
||||
{
|
||||
userId: data.user.id,
|
||||
bot: data.user.bot,
|
||||
userId: data.user ? data.user.id : null,
|
||||
bot: data.user ? data.user.bot : false,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue