3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

remove code duplicate

This commit is contained in:
almeidx 2021-08-29 11:41:21 +01:00
parent 4c4f5854c1
commit a343ceb3aa
No known key found for this signature in database
GPG key ID: 8558FBFF849BD664

View file

@ -97,21 +97,18 @@ export const ReplyAction = automodAction({
const messageContent = validateAndParseMessageContent(formatted);
let replyMsg: Message;
const messageOpts: MessageOptions = {
...messageContent,
allowedMentions: {
users: [user.id],
},
};
if (typeof actionConfig !== "string" && actionConfig.use_inline_reply) {
const originalMsg = await channel.messages.fetch(_contexts[0].message!.id);
replyMsg = await originalMsg.reply({
...messageContent,
allowedMentions: {
users: [user.id],
},
});
replyMsg = await originalMsg.reply(messageOpts);
} else {
replyMsg = await channel.send({
...messageContent,
allowedMentions: {
users: [user.id],
},
});
replyMsg = await channel.send(messageOpts);
}
if (typeof actionConfig === "object" && actionConfig.auto_delete) {