mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 01:25:02 +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 * as t from "io-ts";
|
||||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||||
import { LogType } from "../../../data/LogType";
|
|
||||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||||
import {
|
import {
|
||||||
convertDelayStringToMS,
|
convertDelayStringToMS,
|
||||||
|
@ -95,7 +94,6 @@ export const ReplyAction = automodAction({
|
||||||
}
|
}
|
||||||
|
|
||||||
const messageContent = validateAndParseMessageContent(formatted);
|
const messageContent = validateAndParseMessageContent(formatted);
|
||||||
let replyMsg: Message;
|
|
||||||
|
|
||||||
const messageOpts: MessageOptions = {
|
const messageOpts: MessageOptions = {
|
||||||
...messageContent,
|
...messageContent,
|
||||||
|
@ -105,12 +103,14 @@ export const ReplyAction = automodAction({
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof actionConfig !== "string" && actionConfig.use_inline_reply) {
|
if (typeof actionConfig !== "string" && actionConfig.use_inline_reply) {
|
||||||
const originalMsg = await channel.messages.fetch(_contexts[0].message!.id);
|
messageOpts.reply = {
|
||||||
replyMsg = await originalMsg.reply(messageOpts);
|
failIfNotExists: false,
|
||||||
} else {
|
messageReference: _contexts[0].message!.id,
|
||||||
replyMsg = await channel.send(messageOpts);
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const replyMsg = await channel.send(messageOpts);
|
||||||
|
|
||||||
if (typeof actionConfig === "object" && actionConfig.auto_delete) {
|
if (typeof actionConfig === "object" && actionConfig.auto_delete) {
|
||||||
const delay = convertDelayStringToMS(String(actionConfig.auto_delete))!;
|
const delay = convertDelayStringToMS(String(actionConfig.auto_delete))!;
|
||||||
setTimeout(() => !replyMsg.deleted && replyMsg.delete().catch(noop), delay);
|
setTimeout(() => !replyMsg.deleted && replyMsg.delete().catch(noop), delay);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue