mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix(discord-bot): check for role position
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
es2021: true,
|
||||
node: true
|
||||
},
|
||||
extends: 'eslint:recommended',
|
||||
overrides: [],
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module'
|
||||
},
|
||||
rules: {
|
||||
indent: ['error', 'tab'],
|
||||
'linebreak-style': ['error', 'windows'],
|
||||
quotes: ['error', 'single'],
|
||||
semi: ['error', 'always']
|
||||
}
|
||||
};
|
||||
@@ -11,7 +11,12 @@ export default {
|
||||
.setName('Train Message')
|
||||
.setType(ApplicationCommandType.Message),
|
||||
async execute(interaction) {
|
||||
if (!interaction.member.roles.cache.get(global.config.discord.trainRole))
|
||||
// Prettier and ESLint doesn't like to play nicely here.
|
||||
if (
|
||||
interaction.member.roles.highest.position <
|
||||
interaction.member.guild.roles.cache.get(global.config.discord.trainRole)
|
||||
.position
|
||||
)
|
||||
return interaction.reply({
|
||||
content: 'You don\'t have the permission to do this.',
|
||||
ephemeral: true
|
||||
|
||||
Reference in New Issue
Block a user