mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
Fixed supposed-to-be-ephemeral message not being ephemeral
This commit is contained in:
parent
e4e7e1c695
commit
0fee24e973
1 changed files with 13 additions and 6 deletions
|
@ -32,7 +32,10 @@ async function sendExpandedCases(
|
||||||
show: boolean | null,
|
show: boolean | null,
|
||||||
) {
|
) {
|
||||||
if (casesCount > maxExpandedCases) {
|
if (casesCount > maxExpandedCases) {
|
||||||
await sendContextResponse(context, "Too many cases for expanded view. Please use compact view instead.");
|
await sendContextResponse(context, {
|
||||||
|
content: "Too many cases for expanded view. Please use compact view instead.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -72,17 +75,21 @@ async function casesUserCmd(
|
||||||
user instanceof UnknownUser && cases.length ? cases[cases.length - 1].user_name : renderUsername(user);
|
user instanceof UnknownUser && cases.length ? cases[cases.length - 1].user_name : renderUsername(user);
|
||||||
|
|
||||||
if (cases.length === 0) {
|
if (cases.length === 0) {
|
||||||
await sendContextResponse(context, `No cases found for **${userName}**${modId ? ` by ${modName}` : ""}.`);
|
await sendContextResponse(context, {
|
||||||
|
content: `No cases found for **${userName}**${modId ? ` by ${modName}` : ""}.`,
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const casesToDisplay = hidden ? cases : normalCases;
|
const casesToDisplay = hidden ? cases : normalCases;
|
||||||
|
|
||||||
if (!casesToDisplay.length) {
|
if (!casesToDisplay.length) {
|
||||||
await sendContextResponse(
|
await sendContextResponse(context, {
|
||||||
context,
|
content: `No normal cases found for **${userName}**. Use "-hidden" to show ${cases.length} hidden cases.`,
|
||||||
`No normal cases found for **${userName}**. Use "-hidden" to show ${cases.length} hidden cases.`,
|
ephemeral: true,
|
||||||
);
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue