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:
parent
4c4f5854c1
commit
a343ceb3aa
1 changed files with 9 additions and 12 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue