Replies: 1 comment 2 replies
-
My query directly is: why do your commands fail if one is already running? This isn't something discord.py does, as that isn't "async" in nature. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
is there any way to implement something like a Load Balancer or how to use concurrency in slash commands using discord.py?
My bot architecture is as follow
Actually when the client calls the load balancer, it decides which of the 4 Rest APIs processes to call. In this architecture, the discord.py does absolutely nothing, but almost everything is delegated to the rest APIs.
This is good but the problem is that when someone uses a slash command inside Discord.py client and another user uses another command, the bot responds with: "The application did not respond" until the first command has finished its execution.
I was thinking of running 4 discord.py processes, but how can i balance them with a load balancer?
Actually if i do something like that, the bot is more responsive but it "bugs" itself, as i receive multiple "Interaction Not Found" or "This interaction has already been responded before", so this is not the actual solution I guess
I'm not a genius and my code is dirty, but you can see the bot code here:
https://github.com/blastbeng/discord-tts-bot/blob/main/client/main.py
It is not public, I'm just using it on my own server
The way i start the bot is that:
and a simple slashcommand:
Thanks
Beta Was this translation helpful? Give feedback.
All reactions