allow owner to check roles
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
|||||||
SlashCommandBuilder, EmbedBuilder, PermissionsBitField
|
SlashCommandBuilder, EmbedBuilder, PermissionsBitField
|
||||||
} from 'discord.js'
|
} from 'discord.js'
|
||||||
import { execute, type PermsNumbers } from '../db'
|
import { execute, type PermsNumbers } from '../db'
|
||||||
|
import { owner_id } from '../config.json'
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
global: false,
|
global: false,
|
||||||
@@ -15,9 +16,11 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((interaction.memberPermissions?.has(PermissionsBitField.Flags.ManageRoles, true)) !== true) {
|
if (interaction.user.id !== owner_id) {
|
||||||
await interaction.reply({ content: 'I am sorry dave, I\'m afraid I cannot do that\nYou don\'t have the permission to manage roles on this server', ephemeral: true })
|
if ((interaction.memberPermissions?.has(PermissionsBitField.Flags.ManageRoles, true)) !== true) {
|
||||||
return
|
await interaction.reply({ content: 'I am sorry dave, I\'m afraid I cannot do that\nYou don\'t have the permission to manage roles on this server', ephemeral: true })
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const permissionList = await execute('SELECT * FROM permissions') as Array<{ guild: string, role: string } & PermsNumbers>
|
const permissionList = await execute('SELECT * FROM permissions') as Array<{ guild: string, role: string } & PermsNumbers>
|
||||||
|
|||||||
Reference in New Issue
Block a user