mirror of
https://github.com/sern-handler/awesome-plugins
synced 2026-06-15 12:22:23 +00:00
chore: update JavaScript plugins
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// @ts-nocheck
|
||||
|
||||
/**
|
||||
* @plugin
|
||||
* This is perm check, it allows users to parse the permission you want and let the plugin do the rest. (check bot or user for that perm).
|
||||
*
|
||||
* @author @Benzo-Fury [<@762918086349029386>]
|
||||
@@ -17,6 +18,7 @@
|
||||
* }
|
||||
* })
|
||||
* ```
|
||||
* @end
|
||||
*/
|
||||
import { CommandControlPlugin, controller } from "@sern/handler";
|
||||
|
||||
@@ -36,7 +38,7 @@ export function requirePermission(target, perm, response) {
|
||||
if (ctx.guild === null) {
|
||||
ctx.reply(payload("This command cannot be used here"));
|
||||
console.warn(
|
||||
"PermCheck > A command stopped because we couldn't check a users permissions (was used in dms)"
|
||||
"PermCheck > A command stopped because we couldn't check a users permissions (was used in dms)",
|
||||
); //delete this line if you dont want to be notified when a command is used outside of a guild/server
|
||||
|
||||
return controller.stop();
|
||||
@@ -53,7 +55,7 @@ export function requirePermission(target, perm, response) {
|
||||
if (!bot.permissions.has(perm)) {
|
||||
if (!response)
|
||||
response = `I cannot use this command, please give me \`${perm.join(
|
||||
", "
|
||||
", ",
|
||||
)}\` permission(s).`;
|
||||
await ctx.reply(payload(response));
|
||||
return controller.stop();
|
||||
@@ -66,7 +68,7 @@ export function requirePermission(target, perm, response) {
|
||||
if (!memm.permissions.has(perm)) {
|
||||
if (!response)
|
||||
response = `You cannot use this command because you are missing \`${perm.join(
|
||||
", "
|
||||
", ",
|
||||
)}\` permission(s).`;
|
||||
await ctx.reply(payload(response));
|
||||
return controller.stop();
|
||||
|
||||
Reference in New Issue
Block a user