Changeset 8473982fbfa276ced1394bf704e6de379a0f3e65

Show
Ignore:
Timestamp:
03/15/10 00:08:48 (5 months ago)
Author:
Robin H. Johnson <robbat2@…>
Children:
eb3e6265ef371eda4594f59c872fbb68e1998441
Parents:
53c82a94714e439c63a65fccdaf2512383cffb7a
git-author:
Robin H. Johnson <robbat2@gentoo.org> 1268472688 +0000
git-committer:
Robin H. Johnson <robbat2@gentoo.org> 1268600928 +0000
Message:

basics: implement a channel list status query

This gets the list of channels we think we are in (not what the server says we are in).

Signed-off-by: Robin H. Johnson <robbat2@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lib/rbot/core/basics.rb

    r4ff73e4 r8473982  
    6868      @bot.part m.target if m.public? 
    6969    end 
     70  end 
     71 
     72  def bot_channel_list(m, param) 
     73    ret = _('I am in: ') 
     74    # sort the channels by the base name and then map with prefixes for the 
     75    # mode and display. 
     76    ret << @bot.channels.compact.sort { |a,b| 
     77        a.name.downcase <=> b.name.downcase 
     78    }.map { |c| 
     79        c.modes_of(@bot.myself).map{ |mo| 
     80          m.server.prefix_for_mode(mo) 
     81        }.to_s + c.name 
     82    }.join(', ') 
     83    m.reply ret 
    7084  end 
    7185 
     
    213227  :defaults => {:chan => nil}, 
    214228  :auth_path => 'move' 
     229basics.map "channels", 
     230  :action => 'bot_channel_list', 
     231  :auth_path => 'move' 
    215232basics.map "hide", 
    216233  :action => 'bot_hide',