#++\r
\r
\r
-class CoreModule < CoreBotModule\r
+class BasicsModule < CoreBotModule\r
\r
def listen(m)\r
- return unless m.class <= PrivMessage\r
+ return unless m.kind_of?(PrivMessage)\r
if(m.private? && m.message =~ /^\001PING\s+(.+)\001/)\r
@bot.notice m.sourcenick, "\001PING #$1\001"\r
@bot.irclog "@ #{m.sourcenick} pinged me"\r
# @bot.say m.replyto, @lang.get("hello_X") % m.sourcenick\r
\r
# handle help requests for "core" topics\r
- def help(topic="")\r
+ def help(plugin, topic="")\r
case topic\r
when "quit"\r
return "quit [<message>] => quit IRC with message <message>"\r
return "talk [in here|<channel>] => with no arguments, resume speaking in all channels, if \"in here\", resume speaking in this channel, or resume speaking in <channel>"\r
when "version"\r
return "version => describes software version"\r
- # when "botsnack"\r
- # return "botsnack => reward #{myself} for being good"\r
- # when "hello"\r
- # return "hello|hi|hey|yo [#{myself}] => greet the bot"\r
+ # when "botsnack"\r
+ # return "botsnack => reward #{myself} for being good"\r
+ # when "hello"\r
+ # return "hello|hi|hey|yo [#{myself}] => greet the bot"\r
else\r
- return "Core help topics: quit, restart, config, join, part, hide, save, rescan, nick, say, action, topic, quiet, talk, version, botsnack, hello"\r
+ return "#{name}: quit, restart, join, part, hide, save, rescan, nick, say, action, topic, quiet, talk, version"#, botsnack, hello"\r
end\r
end\r
end\r
\r
-core = CoreModule.new\r
+basics = BasicsModule.new\r
\r
-core.map "quit *msg",\r
+basics.map "quit *msg",\r
:action => 'bot_quit',\r
:defaults => { :msg => nil },\r
:auth_path => 'quit'\r
-core.map "restart *msg",\r
+basics.map "restart *msg",\r
:action => 'bot_restart',\r
:defaults => { :msg => nil },\r
:auth_path => 'quit'\r
\r
-core.map "quiet",\r
+basics.map "quiet",\r
:action => 'bot_quiet',\r
:auth_path => 'talk::set'\r
-core.map "quiet in :chan",\r
+basics.map "quiet in :chan",\r
:action => 'bot_quiet',\r
:auth_path => 'talk::set'\r
-core.map "talk",\r
+basics.map "talk",\r
:action => 'bot_talk',\r
:auth_path => 'talk::set'\r
-core.map "quiet in :chan",\r
+basics.map "quiet in :chan",\r
:action => 'bot_quiet',\r
:auth_path => 'talk::set'\r
\r
-core.map "say :where *what",\r
+basics.map "say :where *what",\r
:action => 'bot_say',\r
:auth_path => 'talk::do'\r
-core.map "action :where *what",\r
+basics.map "action :where *what",\r
:action => 'bot_action',\r
:auth_path => 'talk::do'\r
-core.map "mode :where :what *who",\r
+basics.map "mode :where :what *who",\r
:action => 'bot_mode',\r
:auth_path => 'talk::do'\r
\r
-core.map "join :chan :pass", \r
+basics.map "join :chan :pass", \r
:action => 'bot_join',\r
:defaults => {:pass => nil},\r
:auth_path => 'move'\r
-core.map "part :chan",\r
+basics.map "part :chan",\r
:action => 'bot_part',\r
:defaults => {:chan => nil},\r
:auth_path => 'move'\r
-core.map "hide",\r
+basics.map "hide",\r
:action => 'bot_hide',\r
:auth_path => 'move'\r
\r
-core.map "ping",\r
+basics.map "ping",\r
:action => 'bot_ping',\r
:auth_path => '!ping!'\r
-core.map "help *topic",\r
+basics.map "help *topic",\r
:action => 'bot_help',\r
:default => { :topic => [""] },\r
:auth_path => '!help!'\r
\r
-core.default_auth('*', false)\r
+basics.default_auth('*', false)\r
\r