mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-07 16:05:01 +00:00
Fixes, refactoring and PR feedback
This commit is contained in:
parent
0be54912c4
commit
893a77d562
202 changed files with 1037 additions and 1069 deletions
|
@ -34,13 +34,11 @@ export async function waitForButtonConfirm(
|
|||
.setCustomId(`cancelButton:${idMod}:${uuidv4()}`),
|
||||
]);
|
||||
const sendMethod = () => {
|
||||
return contextIsInteraction
|
||||
? context.replied
|
||||
? context.editReply.bind(context)
|
||||
: context.reply.bind(context)
|
||||
: "send" in context
|
||||
? context.send.bind(context)
|
||||
: context.channel.send.bind(context.channel);
|
||||
if (contextIsInteraction) {
|
||||
return context.replied ? context.editReply.bind(context) : context.reply.bind(context);
|
||||
} else {
|
||||
return "send" in context ? context.send.bind(context) : context.channel.send.bind(context.channel);
|
||||
}
|
||||
};
|
||||
const extraParameters = contextIsInteraction ? { fetchReply: true, ephemeral: true } : {};
|
||||
const message = (await sendMethod()({ ...toPost, components: [row], ...extraParameters })) as Message;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue