#๐Ÿ”’ Bank, cog and json

16 messages ยท Page 1 of 1 (latest)

runic torrentBOT
#

@delicate vale

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

fierce valve
#

first of all, why are you using @bot.tree.command in a cog

#

you should be using @app_commands.command

#

!paste - and show the code causing this issue

runic torrentBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

delicate vale
#

Yes that what I saw somewhere. But I really want commands to appear when I write a "/". Any solution? Can't find or simply don't understand maybe

glad glade
#

Please don't use json as database

fierce valve
#

how do you tell where anything is?

#

like npty said, you need to change to a SQLite database at the bare minimum

glad glade
#

It can almost always trace back to either:

  1. You stored a version of old dated data that you are using and forget to update it
  2. You forgot to save the data you updated
  3. Race conditions in async
#

Solution:

  1. Never store any copy of user data in memory persistently unless they are constant, or any change doesn't matter
  2. Write some cleaner code that makes it obvious to yourself
  3. Use SQL, maybe with lock
delicate vale
#

Ah "horrible". So I redo all and... ok. First time coding sorry

runic torrentBOT
#
Python help channel closed using Discord native close action

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.