Mathias
Explore posts from serversPPrisma
•Created by Mathias on 11/19/2024 in #help-and-questions
Concurrent request (Prisma)
Hello,
I have a problem with Prisma on PostgreSQL. I don't know how to fix it
Context
I have a questionnaire to answer. When the person click on the questionnaire, I create
entry in the database. The backend sends the generated line ID (UUID) to the frontend. Then, each time the user's answers on the questionnaire are modified, the frontend sends the data to the backend, which updates them using this UUID
Problem: in rare cases, if I send the query twice in a row, it may create two rows in the database
Constraint: I can't have a unique constraint in the answers table, as a questionnaire can sometimes (not always) have several answers
Any advice on how to create a lock with Prisma / PostgreSQL to avoid having 2 inserts at the same time for the same user?
Thanks!8 replies
SIASapphire - Imagine a framework
•Created by Mathias on 4/27/2024 in #sapphire-support
Error [UNLOADED_PIECE]: The piece 'ready' does not exist.
Hello !
On this code :
I have this error:
When I remove
once
, it's working
Why?
Thanks!17 replies
SIASapphire - Imagine a framework
•Created by Mathias on 12/27/2023 in #sapphire-support
Create WebServer with Plugin API
Hello !
I read the doc for install a webserver in my bot.
Here my code:
These lines should open a web server on 8080 port, no ?
14 replies
DIAdiscord.js - Imagine an app
•Created by Mathias on 12/25/2023 in #djs-questions
Error format
Hello !
I'm testing to create a channel when the category is full. I get this error in a catch() of create():
Why I need to access to
error.rawError.errors.parent_id._errors[0].code
to get the error ?
In a different situation, for example when I can't send a DM to a user, it's much clearer than that8 replies
SIASapphire - Imagine a framework
•Created by Mathias on 12/25/2023 in #sapphire-support
Any tips for store data in the interaction ?
Hello
What is the best way to store data through interactions?
Today, I put everything in the customId of the interaction, but it is limited to 100 characters...
Do you have tips?
Thanks!
13 replies
SIASapphire - Imagine a framework
•Created by Mathias on 12/24/2023 in #sapphire-support
Error handling
Hello !
Is there anything native to Sapphire that allows error handling?
I want to capture all the bot's unhandled errors and to be able to act on them.
Thanks!
8 replies
SIASapphire - Imagine a framework
•Created by Mathias on 12/23/2023 in #sapphire-support
Error when loading events
Hello !
I'm creating a Discord bot with Sapphire and when I create an event, I have this error :
Error when loading '/home/desk/bot-sapphire/common/src/ticket/listeners/ready.js': Error: Dynamic require of "/home/desk/bot-sapphire/common/src/ticket/listeners/ready.js" is not supported
I'm using ESM!
Thanks
14 replies
SIASapphire - Imagine a framework
•Created by Mathias on 12/10/2023 in #sapphire-support
How to config baseUserDirectory
Hello
I have a bot and I want to sort my bot module in differents folders :
For example :
How do I need to setup my baseUserDirectory for check commands on all folders ?
Thanks!
5 replies
SIASapphire - Imagine a framework
•Created by Mathias on 11/4/2023 in #sapphire-support
Setup 3 bots with Sapphire
Hello !
I'd like to set up 3 bots with Sapphire. But I'd like to have everything in the same code to share certain components.
What I'm doing for the moment is creating 3 instances of SapphireClient, in which I define a path to retrieve commands, listeners, etc ...
My problem: I'd like to add access to my database in container but I can't see how to do it.
Is it possible to define a property in container as soon as SapphireClient is initialised?
Thanks!
(this is my first experience with SapphireClient)
21 replies
DIAdiscord.js - Imagine an app
•Created by Mathias on 10/20/2023 in #djs-questions
Unknown interaction
Hello
I have a problem that I can't figure out. I understand the principle of deferring an answer, but in this case I'm having trouble.
What I'd like to do: Change the embed and the drop-down menu each time an answer is selected:
It works great!
But from time to time (very rarely), this error is generated:
DiscordAPIError[10062]: Unknown interaction
How to correct it?
Thanks!14 replies