Fix permission checks on api/inline/alias
This commit is contained in:
parent
6e71878d42
commit
7744d3a72e
|
@ -32,7 +32,7 @@ const sortYVars = (a: string, b: string) => {
|
|||
};
|
||||
|
||||
const handleAddUpdate = async (message: DiscordenoMessage, guildMode: boolean, argSpaces: string[], replaceAlias: boolean) => {
|
||||
if (guildMode && !(await hasGuildPermissions(message.authorId, message.guildId, ['ADMINISTRATOR']))) {
|
||||
if (guildMode && !(await hasGuildPermissions(message.guildId, message.authorId, ['ADMINISTRATOR']))) {
|
||||
message
|
||||
.send({
|
||||
embeds: [
|
||||
|
|
|
@ -10,7 +10,7 @@ import { failColor, successColor, warnColor } from 'embeds/colors.ts';
|
|||
import utils from 'utils/utils.ts';
|
||||
|
||||
const handleDelete = async (message: DiscordenoMessage, guildMode: boolean, argSpaces: string[], deleteAll: boolean) => {
|
||||
if (guildMode && !(await hasGuildPermissions(message.authorId, message.guildId, ['ADMINISTRATOR']))) {
|
||||
if (guildMode && !(await hasGuildPermissions(message.guildId, message.authorId, ['ADMINISTRATOR']))) {
|
||||
message
|
||||
.send({
|
||||
embeds: [
|
||||
|
|
|
@ -16,7 +16,7 @@ interface QueryShape {
|
|||
}
|
||||
|
||||
export const clone = async (message: DiscordenoMessage, guildMode: boolean, argSpaces: string[]) => {
|
||||
if (!guildMode && !(await hasGuildPermissions(message.authorId, message.guildId, ['ADMINISTRATOR']))) {
|
||||
if (!guildMode && !(await hasGuildPermissions(message.guildId, message.authorId, ['ADMINISTRATOR']))) {
|
||||
message
|
||||
.send({
|
||||
embeds: [
|
||||
|
|
|
@ -14,7 +14,7 @@ interface QueryShape {
|
|||
}
|
||||
|
||||
export const rename = async (message: DiscordenoMessage, guildMode: boolean, argSpaces: string[]) => {
|
||||
if (guildMode && !(await hasGuildPermissions(message.authorId, message.guildId, ['ADMINISTRATOR']))) {
|
||||
if (guildMode && !(await hasGuildPermissions(message.guildId, message.authorId, ['ADMINISTRATOR']))) {
|
||||
message
|
||||
.send({
|
||||
embeds: [
|
||||
|
|
|
@ -36,7 +36,7 @@ export const api = async (message: DiscordenoMessage, args: string[]) => {
|
|||
}
|
||||
|
||||
// Makes sure the user is authenticated to run the API command
|
||||
if (await hasGuildPermissions(message.authorId, message.guildId, ['ADMINISTRATOR'])) {
|
||||
if (await hasGuildPermissions(message.guildId, message.authorId, ['ADMINISTRATOR'])) {
|
||||
switch (apiArg) {
|
||||
case 'help':
|
||||
case 'h':
|
||||
|
|
|
@ -51,8 +51,7 @@ export const toggleInline = async (message: DiscordenoMessage, args: string[]) =
|
|||
});
|
||||
if (errorOut) return;
|
||||
|
||||
// Makes sure the user is authenticated to run the API command
|
||||
if (await hasGuildPermissions(message.authorId, message.guildId, ['ADMINISTRATOR'])) {
|
||||
if (await hasGuildPermissions(message.guildId, message.authorId, ['ADMINISTRATOR'])) {
|
||||
let enable = false;
|
||||
switch (apiArg) {
|
||||
case 'allow':
|
||||
|
|
Loading…
Reference in New Issue