#Slash Command Error
1 messages · Page 1 of 1 (latest)
All fields are required. To make it optional you assign it a default value in the async def
You have not made a slash command however.
https://guide.disnake.dev/interactions/slash-commands
We have a collection of guides that goes into debth about the fundamentals
I suggest you poke around there
disnake doesn't use a tree
and don't do this:
async def on_ready():
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name='your every move'))
There's a lot of errors in the paste you linked.
For starters you should use a bot, not a client
Look at this to get started https://guide.disnake.dev/getting-started/initial-files
And come back if you have issues getting this to work
I'd suggest starting here:
https://wiki.python.org/moin/BeginnersGuide
Actually learning the language and build a base knowledge of programming in general will go a very long way
100%
well naturally.
because you're trying to use discord slash commands with disnake.
It looks like this is probably all you have done.. do yourself a favor and don't try to translate disnake = discord Just write in in disnake and eliminate the self confusion
drop the on_message.
That is NOT how you make commands
negative
not really necessary since you're trying to use slash commands.
But also it would be @bot.command()
for each command
discord = disnake
intents = discord.Intents.default()
intents.typing = True
intents.presences = True
intents.message_content = True
intent = discord.Intents
client = discord.Client(intents=intents)
bot = commands.Bot(command_prefix="!", intents = discord.Intents.all())
and this is absolutely pointless.
you're defining all these intents, then just passing disnake.Intents.all() to the bot constructor
like.. if you're going to do that, you don't need to define all the intents above
And you don't need Client AND commands.Bot
one or the other
I urge you to read: https://guide.disnake.dev
specifically: https://guide.disnake.dev/getting-started/creating-commands
and https://guide.disnake.dev/interactions/slash-commands
you're using client.run and there's nothing registered to the client.
like...
look at the code examples.
and delete all the client stuff
wut
type hint disnake.Member or disnake.User. depends on if it's a guild command or not
you would annotate the type
In this case it would be disnake.Member or disnake.User
a disnake.Member is essentially just a disnake.User that has a guild and a couple extra methods like add_roles and guild specific stuff like that
-d disnake.Member
property id```
Equivalent to [`User.id`](https://docs.disnake.dev/page/api.html#disnake.User.id "disnake.User.id")
user: disnake.Member.id thats not valid scrap the .id
Use docstrings
then you're not looking hard enough because that link literally provides an example
Marked the thread as solved. If your question has not been answered, please open a new thread in #1019642966526140566.