'discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
import discord
from discord.ext import commands
from discord import guild
from discord_slash import SlashCommand, SlashContext
from discord_slash.utils.manage_commands import create_choice, create_option
client = commands.Bot(command_prefix=';', case_insensitive=True)
slash = SlashCommand(client, sync_commands=True)
@client.event
async def on_connect():
print('Bot Online')
@slash.slash(
name='Hi',
description='Hi Command',
guild_ids=[947837363529326623]
)
async def _hello(ctx):
await ctx.send('Hello')
Task exception was never retrieved future: <Task finished name='Task-1' coro=<SlashCommand.sync_all_commands() done, defined at C:\Users\Admin\PycharmProjects\BotDiscord\virenv\lib\site-packages\discord_slash\client.py:416> exception=Forbidden('403 Forbidden (error code: 50001): Missing Access')> Traceback (most recent call last): File "C:\Users\Admin\PycharmProjects\BotDiscord\virenv\lib\site-packages\discord_slash\client.py", line 440, in sync_all_commands existing_cmds = await self.req.get_all_commands(guild_id=scope) File "C:\Users\Admin\PycharmProjects\BotDiscord\virenv\lib\site-packages\discord\http.py", line 248, in request raise Forbidden(r, data) discord.errors.Forbidden: 403 Forbidden (error code: 50001): Missing Access
Solution 1:[1]
It looks like you did not enable applications.build in the portal when inviting the bot. On top of enabling the bot, to create slash _commands you need to enable applications.build as well
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Fishball Nooodles |
