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

Mutiple bots #91

Open
foremtehan opened this issue Nov 7, 2023 · 3 comments
Open

Mutiple bots #91

foremtehan opened this issue Nov 7, 2023 · 3 comments

Comments

@foremtehan
Copy link

How can i use zanzara when i have many bots? because zanzara only works with single bot

@valzargaming
Copy link

valzargaming commented Jan 1, 2024

AFAIK you would just need to construct your own loop interface and pass it into the Zanzara object's construction via the $config parameter, and starting the loop would start all the bots associated with it. Per the construct method:

public function __construct(string $botToken, ?Config $config = null)
    {
        $this->config = $config ?? new Config(); // You would need to create your own Config()
        $this->loop = $this->config->getLoop() ?? Loop::get(); //ReactPHP loop is retrieved

You would also need to define multiple Zanzara objects, one per bot.

@foremtehan
Copy link
Author

foremtehan commented Apr 29, 2024

There's one problem: they're all using webhooks instead of long polling. It would be helpful to have an example in the doc @cheeghi

@valzargaming
Copy link

valzargaming commented Apr 29, 2024

@foremtehan, I'm not sure exactly what you're looking for. Are you saying that you have a webserver that's using NGINX, Apache, or something similar? That's the only reason I can think of where you'd only be able to be using webhooks, and ReactPHP applications cannot be run from any of those. Alternatively, you could look into implementing a React HTTP server and set up endpoints for your webhooks that all your other bots can point to and send their data that way.

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