hay

I did not do much with APE lately, but i guess that you could do something like this (untested):




Ape.registerHookCmd( "connect", function( params, cmd ) {
        if ( ! $defined(params) || ! $defined(params.name)) return 0;
        cmd.user.setProperty('name', params.name);
        return 1;
});

Ape.addEvent( "mkChan", function( channel ) {
        channel.setProperty( 'new', true );
});

Ape.addEvent( "join", function( user, channel ) {
        if ( channel.getProperty( 'new' )  {
                channel.setProperty( 'admin',  user.getProperty( 'name' ) );
                channel.delProperty(' new' );
} else if ( channel.getProperty( 'bot' ) && channel.getProperty( 'admin' ) == user.getProperty( 'name' ) ) {
                channel.delProperty( 'bot' );
        }
});

Ape.addEvent("left", function( user, channel ) {
if ( ! channel.getProperty( 'bot' ) && channel.getProperty( 'admin' ) == user.getProperty( 'name' ) ) {
                channel.setProperty( 'bot',  true );
        }
});




Peter
Nikolay G. schreef op 2014-12-23 08:42:
Hello, for my realization I need when admin user (first user who
create channel - lets name him "admin") is quit from channel, channel
is not closed (where admin is alone in channel) I want to create bot
of admin. When admin user is come back, Im can check out if bot is
channel and delete him.
Any ideas how I can do that?

Thx.

 --
 --
 You received this message because you are subscribed to the Google
 Groups "APE Project" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to
 [email protected]
 For more options, visit this group at
 http://groups.google.com/group/ape-project?hl=en [1]
 ---
 APE Project (Ajax Push Engine)
 Official website : http://www.ape-project.org/ [2]
 Git Hub : http://github.com/APE-Project/ [3]

 ---
 You received this message because you are subscribed to the Google
Groups "APE Project" group.
 To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected] [4].
 For more options, visit https://groups.google.com/d/optout [5].


Links:
------
[1] http://groups.google.com/group/ape-project?hl=en
[2] http://www.ape-project.org/
[3] http://github.com/APE-Project/
[4] mailto:[email protected]
[5] https://groups.google.com/d/optout

--
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

--- You received this message because you are subscribed to the Google Groups "APE Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to