fix(automod): don't try to reply with an empty message
This commit is contained in:
parent
3b98c3bdc1
commit
ff160be1fa
1 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,7 @@ import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions";
|
|||
import { automodAction } from "../helpers";
|
||||
import { AutomodContext } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { messageIsEmpty } from "../../../utils/messageIsEmpty";
|
||||
|
||||
export const ReplyAction = automodAction({
|
||||
configType: t.union([
|
||||
|
@ -109,6 +110,10 @@ export const ReplyAction = automodAction({
|
|||
};
|
||||
}
|
||||
|
||||
if (messageIsEmpty(messageOpts)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const replyMsg = await channel.send(messageOpts);
|
||||
|
||||
if (typeof actionConfig === "object" && actionConfig.auto_delete) {
|
||||
|
|
Loading…
Add table
Reference in a new issue