mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-14 05:57:18 +00:00
Add canActOn check
This commit is contained in:
parent
93bc15a7de
commit
71a4216af8
1 changed files with 5 additions and 1 deletions
|
@ -7,7 +7,7 @@ import {
|
|||
simpleClosestStringMatch,
|
||||
stripObjectToScalars,
|
||||
} from "../../../utils";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { VoiceChannel } from "eris";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { resolveChannel } from "knub/dist/helpers";
|
||||
|
@ -23,6 +23,10 @@ export const VcdisconnectCmd = utilityCmd({
|
|||
},
|
||||
|
||||
async run({ message: msg, args, pluginData }) {
|
||||
if (!canActOn(pluginData, msg.member, args.member)) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Cannot move: insufficient permissions");
|
||||
}
|
||||
|
||||
if (!args.member.voiceState || !args.member.voiceState.channelID) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Member is not in a voice channel");
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue