This repository was archived by the owner on Aug 7, 2023. It is now read-only.
Getting error with base #480
Answered
by
jnsougata
SlumberDemon
asked this question in
Help
-
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/disnake/ext/commands/slash_core.py", line 285, in invoke
await call_param_func(self.callback, inter, self.cog, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/disnake/ext/commands/params.py", line 778, in call_param_func
return await maybe_coroutine(safe_call, function, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/disnake/utils.py", line 561, in maybe_coroutine
return await value
File "/Users/??/Desktop/Api/boat/src/cogs/countries.py", line 229, in test
await create_at_board(
File "/Users/??/Desktop/Api/boat/src/extras/func.py", line 10, in create_at_board
db.put({"item": item}, userId)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/deta/base.py", line 152, in put
code, res = self._request("/items", "PUT", {"items": [data]}, content_type=JSON_MIME)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/deta/service.py", line 85, in _request
raise urllib.error.HTTPError(url, status, res.reason, res.headers, res.fp)
urllib.error.HTTPError: HTTP Error 400: Bad Requestcode: async def create_at_board(userId: int, item: Union[list, dict], board: str):
db = deta.Base(board)
db.put({"item": item}, userId) |
Beta Was this translation helpful? Give feedback.
Answered by
jnsougata
Sep 16, 2022
Replies: 2 comments 5 replies
-
|
You need to insert a document into your db. As usual, the document needs to be a JavaScript object or a Python dictionary. async def create_at_board(userId: int, item: Union[list, dict], board: str):
db = deta.Base(board)
db.put({"item": item, "userId": userId}) |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
your user id is an integer, convert it to a string to use as key to json |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
SlumberDemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
your user id is an integer, convert it to a string to use as key to json