- putsock(client, "PART %s :magic hop", chan->name);
- putsock(client, "JOIN %s", chan->name);
+ struct ClientSocket *bot;
+ //find the last bot in the channel
+ for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) {
+ if(bot->user == chan->chanbot) {
+ putsock(bot, "PART %s :magic hop", chan->name);
+ putsock(bot, "JOIN %s", chan->name);
+ }
+ }