#Cannot use slash commands if i dont have administrator permissions.
1 messages · Page 1 of 1 (latest)
import nextcord
from nextcord.ext import commands
import apikeys
import aiohttp
import os
intents = nextcord.Intents.default()
intents.message_content = True
intents.members = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
await bot.change_presence(status=nextcord.Status.do_not_disturb)
print(f"Logged in as {bot.user}")
print("The bot is now ready for use!")
print("-----------------------------")
@bot.slash_command(name="shutdown", description="Shuts down the bot.")
async def shutdown(interaction: nextcord.Interaction):
await interaction.send("Shutting down bot...")
await bot.close()
await aiohttp.ClientSession().close()
initial_extension = []
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
initial_extension.append("cogs."+ filename[:-3])
if __name__ == "__main__":
for extension in initial_extension:
bot.load_extension(extension)
bot.run(apikeys.bot_token)```
normal perms i mean like member perms
people who dont have administrator
@random hedge
If you are trying to lock it add a check for perms in user that sent interaction.
If you are wondering why it doesn't work with "normal perms" check if @everyon has the following perms enabled in that channel/guild/role
It needs to be one to run bot commands
If it's off they can run the /comand
Yeah I have use application commands permissions on for everyone
But members still cannot see them
what about permissions on channel specifically?
are we talking about that /shutdown command you sent above?
I meant any command
members cannot see any slash command
check you integration settings for commands in server settings
as alternative for testing, add bot to a different new server and see if commands are visible there
yeah i already put them so everyone can use my bot commands, but still nothing shows up
like an override
.
okay
Maby sync your commands or add them to guildids in the command just to test
How do i do that?
nextcord syncs them automatically, don't forget about that
Yes but seems like something is bugging unless they didn't give time
=docs sync_application_commands
so just do bot.sync_application_commands() inside my on_ready function?
Temperley yes