MadelineProto Join more than one group/channel at once

Viewed 200

I use MadelineProtoDocs to create a userbot that do tasks I want. What I want to do is that I want to Join more than one group at once! I have used $MadelineProto->messages->importChatInvite(['hash' => 'HASH_CODE']);

It works when I put a hashcode for one group, but when I put more than one like this:

$MadelineProto->messages->importChatInvite(['hash' => ['HASH_CODE', 'HASH_CODE2']);

it doesn’t work

I also tried:

$MadelineProto->channels->joinChannel(['channel' => [InputChannel, InputChannel], ]);

it also doesn’t work!

1 Answers

I found the solution. It’s easy to do that So when you join a channel or group you do this:

$join = yield $MadelineProto->channels->joinChannel(['channel' => '@channelusername', ]);

By this you will join only one channel/group, so how to add another channel/group in the same code? It’s easy:

$join =
yield $MadelineProto->channels->joinChannel(['channel' => '@channelusername', ]);

yield $MadelineProto->channels->joinChannel(['channel' => '@channelusername1', ]);

yield $MadelineProto->channels->joinChannel(['channel' => '@channelusername2', ]);

and you will join all the channels you added!

Related