Spaces:
Runtime error
Runtime error
Update index.js
Browse files
index.js
CHANGED
|
@@ -788,7 +788,7 @@ async function safeReply(interaction, options) {
|
|
| 788 |
}
|
| 789 |
|
| 790 |
async function sendNoPermission(ctx) {
|
| 791 |
-
const msg = "❌ No Permission";
|
| 792 |
try {
|
| 793 |
if (ctx.isChatInputCommand || ctx.isButton || ctx.isStringSelectMenu || ctx.isUserSelectMenu) {
|
| 794 |
return await safeReply(ctx, { content: msg, flags: [MessageFlags.Ephemeral] });
|
|
@@ -796,8 +796,8 @@ async function sendNoPermission(ctx) {
|
|
| 796 |
const reply = await ctx.reply(msg);
|
| 797 |
setTimeout(() => {
|
| 798 |
reply.delete().catch(() => { });
|
| 799 |
-
ctx.delete().catch(() => { });
|
| 800 |
-
},
|
| 801 |
}
|
| 802 |
} catch (e) { }
|
| 803 |
}
|
|
|
|
| 788 |
}
|
| 789 |
|
| 790 |
async function sendNoPermission(ctx) {
|
| 791 |
+
const msg = "❌ No Permission\n*(Note: Use Slash Commands `/` for private error messages)*";
|
| 792 |
try {
|
| 793 |
if (ctx.isChatInputCommand || ctx.isButton || ctx.isStringSelectMenu || ctx.isUserSelectMenu) {
|
| 794 |
return await safeReply(ctx, { content: msg, flags: [MessageFlags.Ephemeral] });
|
|
|
|
| 796 |
const reply = await ctx.reply(msg);
|
| 797 |
setTimeout(() => {
|
| 798 |
reply.delete().catch(() => { });
|
| 799 |
+
if (ctx.deletable) ctx.delete().catch(() => { });
|
| 800 |
+
}, 3000);
|
| 801 |
}
|
| 802 |
} catch (e) { }
|
| 803 |
}
|