Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple session #66

Open
killerlearner opened this issue May 25, 2023 · 5 comments
Open

Multiple session #66

killerlearner opened this issue May 25, 2023 · 5 comments

Comments

@killerlearner
Copy link

Can you make it so bot can handle multiple active cmd.
At present it don't let use other cmds when one running at background

@andrewlytvyn
Copy link

I ask a question to the chatGPT

@killerlearner
Copy link
Author

What question O⁠_⁠o

@andrewlytvyn
Copy link

To implement the ability for a bot to handle multiple active commands, you would need to create multiple instances of command handling or utilize a concept of "threading" or "parallel processing." This is a significant programming task that would require a solid understanding of node.js (the language this bot appears to be written in) and asynchronous programming principles.

Here's a high-level approach of how you might go about it:

  1. Task Queue: Create a queue for incoming commands. Whenever a command is issued, add it to the queue. This ensures that no commands are lost if multiple commands are issued simultaneously.

  2. Command Handler: Create a command handler that runs on a separate thread or process. This handler should be able to take a command from the queue and execute it. The handler should also be able to handle multiple commands at once. This can be achieved by creating a new thread or process for each command, or by using asynchronous programming techniques to allow the handler to work on multiple commands at the same time.

  3. Output Handling: Ensure that the output from each command is handled correctly. This could involve sending the output back to the user who issued the command, or storing it in a location where it can be accessed later.

  4. Error Handling: Make sure to handle errors properly. If a command fails to execute, the handler should be able to recover and move on to the next command.

  5. Concurrency Control: Implement concurrency control mechanisms to prevent race conditions and other concurrency-related issues. This could involve using locks or other synchronization techniques.

Note that this is a high-level description and the actual implementation would require a deeper understanding of the specific bot's code and the node.js language. If you are not familiar with these concepts, you might want to consider seeking help from a professional developer or a community of developers knowledgeable in node.js and bot development.

However, it's also important to note that running multiple commands concurrently could have security and resource implications. For instance, if the bot is running on a server with limited resources, running too many commands at once could overload the server. Similarly, if commands are not properly isolated from each other, one command could potentially interfere with the execution of another, leading to unexpected behavior or security vulnerabilities. It's crucial to consider these factors when designing and implementing this feature.

@killerlearner
Copy link
Author

Yup that's what we need ;)

@killerlearner
Copy link
Author

It's alright in current mirror bots we just need someone who can develop it for shell bot using mirror bot code as example ig.
IMG_20230527_101940
As you can see in this img that there is a sh for every background process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants