Changeset 63


Ignore:
Timestamp:
12/03/10 13:22:48 (14 years ago)
Author:
nanardon
Message:
  • first bot command
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/web/lib/Sophie/Controller/Chat/Cmd.pm

    • Property svn:keywords set to Id Rev
    r38 r63  
    2222=cut 
    2323 
     24=head1 BOT COMMAND 
     25 
     26=head2 REPLY 
     27 
     28=cut 
     29 
     30sub _commands { 
     31    my ( $self, $c ) = @_; 
     32    [ grep { m/^[^_]/ } map { $_->name } $self->get_action_methods() ]; 
     33} 
     34 
    2435sub help : XMLRPC { 
    2536    my ( $self, $c, $reqspec, @args ) = @_; 
    26     return $c->{stash}->{xmlrpc} = [ grep { m/^[^_]/ } map { $_->name } $self->get_action_methods() ]; 
     37    return $c->{stash}->{xmlrpc} = { 
     38        message => [ 
     39            'availlable command:', 
     40            join(', ', @{ $self->_commands }), 
     41        ], 
     42    } 
    2743} 
    2844 
    2945 
    30 sub me : XMLRPC { 
     46sub asv : XMLRPC { 
     47    my ( $self, $c ) = @_; 
     48    return $c->stash->{xmlrpc} = { 
     49        message => [ 'Sophie ' . $Sophie::VERSION . ' Chat: ' . q$Rev$ ], 
     50    }; 
    3151} 
    3252 
Note: See TracChangeset for help on using the changeset viewer.