mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 01:25:02 +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);
|
const messageContent = validateAndParseMessageContent(formatted);
|
||||||
let replyMsg: Message;
|
let replyMsg: Message;
|
||||||
|
|
||||||
|
const messageOpts: MessageOptions = {
|
||||||
|
...messageContent,
|
||||||
|
allowedMentions: {
|
||||||
|
users: [user.id],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
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);
|
const originalMsg = await channel.messages.fetch(_contexts[0].message!.id);
|
||||||
replyMsg = await originalMsg.reply({
|
replyMsg = await originalMsg.reply(messageOpts);
|
||||||
...messageContent,
|
|
||||||
allowedMentions: {
|
|
||||||
users: [user.id],
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
replyMsg = await channel.send({
|
replyMsg = await channel.send(messageOpts);
|
||||||
...messageContent,
|
|
||||||
allowedMentions: {
|
|
||||||
users: [user.id],
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof actionConfig === "object" && actionConfig.auto_delete) {
|
if (typeof actionConfig === "object" && actionConfig.auto_delete) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue