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

Already on GitHub? Sign in to your account

Does the onJoin method work? #3

Closed
Apathetic012 opened this Issue Dec 9, 2012 · 8 comments

Comments

Projects
None yet
3 participants

Hi, can anyone please shed some light and provide an example for the onJoin command?

$bot = new Philip($config);

$bot->onJoin(function($e){
    var_dump($e);
});

$bot->run();

I tried to see what would get dumped on the screen when I join the channel but I got nothing. Thank you!

BTW What I wanted to do is welcome specific users when they join the channel.

Owner

epochblue commented Dec 9, 2012

The onJoin method does what you want, but it won't respond to you joining a room. It will only respond to other people joining a room you're in already.

(at least - that's what it should do, if it doesn't, please file an issue and I'll fix it)

Owner

epochblue commented Jan 16, 2013

Since I haven't heard anything more from this, I'm going to close it. If there's a problem here, please open a new issue.

@epochblue epochblue closed this Jan 16, 2013

ConneXNL commented Jul 1, 2013

Is there any event it triggers when you actually join the channel?

Owner

epochblue commented Jul 1, 2013

Events aren't thrown when the bot joins a room. Join events are thrown when someone else joins a channel that the bot currently occupies, however. Is this not working?

ConneXNL commented Jul 2, 2013

It is working. But isnt it a little strange we can't send anything to the channel when we join it.

Someone else first has to join/or say something before we can do anything?

Owner

epochblue commented Jul 3, 2013

I apologize for being obtuse, but I'm not sure I understand what you're asking for. As long as the bot is in a channel, it can send messages when other people join the room or talk in the room. Are you asking for the bot to join a room and as soon as it successfully joins a room to say something?

The bot can join any room you want it to, whether there's someone in the room or not, but it won't do much while it's in there unless there are other people (or bots?) in the room to post messages to the channel for the bot to respond to.

ConneXNL commented Jul 6, 2013

"Are you asking for the bot to join a room and as soon as it successfully joins a room to say something?"

Yes. This comes in handy when making bots that act on themselves.

Owner

epochblue commented Jul 8, 2013

OK, well, I think I know how something like this might be implemented. I'll look into adding it.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment