#how to increase the value of a variable after using a slash command

1 messages · Page 1 of 1 (latest)

wintry dust
#

This is not anything exclusive to disnake. This is basic Python scoping.

spice forum
wintry dust
#

Yes. Again, this is a basic Python scoping issue.

#

Functions can read global variables, but not always update them.

#

You would need the global keyword. It would work, but I don't recommend getting in the habit of using it.

#

Also, a note.. you're defining ALL intents, which you probably don't even need, but you aren't passing them to the bot.
Also, use commands.InteractionBot if you're only making app commands. commands.Bot is only necessary if you're planning to add prefix commands, which it doesn't seem you are because you haven't defined a command_prefix.

silver timber
#

That's a lot to throw onto someone who doesn't even know python