mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-21 16:55:03 +00:00
clean up
This commit is contained in:
parent
a343ceb3aa
commit
48089d1831
1 changed files with 7 additions and 7 deletions
|
@ -1,7 +1,6 @@
|
|||
import { Message, MessageOptions, Permissions, Snowflake, TextChannel, ThreadChannel, User } from "discord.js";
|
||||
import { MessageOptions, Permissions, Snowflake, TextChannel, ThreadChannel, User } from "discord.js";
|
||||
import * as t from "io-ts";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import {
|
||||
convertDelayStringToMS,
|
||||
|
@ -95,7 +94,6 @@ export const ReplyAction = automodAction({
|
|||
}
|
||||
|
||||
const messageContent = validateAndParseMessageContent(formatted);
|
||||
let replyMsg: Message;
|
||||
|
||||
const messageOpts: MessageOptions = {
|
||||
...messageContent,
|
||||
|
@ -105,12 +103,14 @@ export const ReplyAction = automodAction({
|
|||
};
|
||||
|
||||
if (typeof actionConfig !== "string" && actionConfig.use_inline_reply) {
|
||||
const originalMsg = await channel.messages.fetch(_contexts[0].message!.id);
|
||||
replyMsg = await originalMsg.reply(messageOpts);
|
||||
} else {
|
||||
replyMsg = await channel.send(messageOpts);
|
||||
messageOpts.reply = {
|
||||
failIfNotExists: false,
|
||||
messageReference: _contexts[0].message!.id,
|
||||
};
|
||||
}
|
||||
|
||||
const replyMsg = await channel.send(messageOpts);
|
||||
|
||||
if (typeof actionConfig === "object" && actionConfig.auto_delete) {
|
||||
const delay = convertDelayStringToMS(String(actionConfig.auto_delete))!;
|
||||
setTimeout(() => !replyMsg.deleted && replyMsg.delete().catch(noop), delay);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue