meimei 0.1.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/.document +5 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +20 -0
  4. data/LICENSE.txt +20 -0
  5. data/README.rdoc +19 -0
  6. data/Rakefile +40 -9
  7. data/VERSION +1 -0
  8. data/cron.sh +8 -0
  9. data/lib/meimei/client.rb +18 -8
  10. data/lib/meimei.rb +0 -25
  11. data/plugins/an2.rb +5 -0
  12. data/plugins/ann.rb +47 -0
  13. data/plugins/autoping.rb +5 -0
  14. data/plugins/cco.rb +4 -0
  15. data/plugins/choose.rb +13 -0
  16. data/plugins/courage.rb +7 -0
  17. data/plugins/dan.rb +13 -0
  18. data/plugins/dg.rb +25 -0
  19. data/plugins/dwiki.rb +6 -0
  20. data/plugins/eta.rb +43 -0
  21. data/plugins/g.rb +30 -0
  22. data/plugins/gc.rb +34 -0
  23. data/plugins/godfinger.rb +9 -0
  24. data/plugins/hammerhell.rb +7 -0
  25. data/plugins/hanase.rb +14 -0
  26. data/plugins/hellheaven.rb +6 -0
  27. data/plugins/help.rb +7 -0
  28. data/plugins/jtime.rb +9 -0
  29. data/plugins/nai_ja_nai.rb +4 -0
  30. data/plugins/note.rb +10 -0
  31. data/plugins/ranking.rb +422 -0
  32. data/plugins/reload.rb +3 -0
  33. data/plugins/retard.rb +4 -0
  34. data/plugins/rs.rb +8 -0
  35. data/plugins/shiningfinger.rb +9 -0
  36. data/plugins/shuffle.rb +3 -0
  37. data/plugins/sugei_inaka.rb +4 -0
  38. data/plugins/suki_dakara.rb +4 -0
  39. data/plugins/ts.rb +25 -0
  40. data/plugins/tsundere.rb +5 -0
  41. data/plugins/tt.rb +50 -0
  42. data/plugins/ttt.rb +5 -0
  43. data/plugins/uptime.rb +20 -0
  44. data/plugins/wawawa.rb +5 -0
  45. data/plugins/weather.rb +39 -0
  46. data/test/helper.rb +18 -0
  47. data/test/test_meimei.rb +7 -0
  48. metadata +139 -56
  49. data/CHANGES +0 -10
  50. data/LICENSE +0 -31
  51. data/README +0 -30
  52. data/lib/meimei/gemspec.rb +0 -45
  53. data/lib/meimei/specification.rb +0 -128
  54. data/lib/meimei/version.rb +0 -18
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ gem 'jeweler'
2
+ gem 'rake'
3
+ gem 'rdoc'
data/Gemfile.lock ADDED
@@ -0,0 +1,20 @@
1
+ GEM
2
+ specs:
3
+ git (1.2.5)
4
+ jeweler (1.8.4)
5
+ bundler (~> 1.0)
6
+ git (>= 1.2.5)
7
+ rake
8
+ rdoc
9
+ json (1.8.0)
10
+ rake (10.0.4)
11
+ rdoc (3.12.2)
12
+ json (~> 1.4)
13
+
14
+ PLATFORMS
15
+ ruby
16
+
17
+ DEPENDENCIES
18
+ jeweler
19
+ rake
20
+ rdoc
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 albert
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = meimei
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to meimei
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 albert. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile CHANGED
@@ -1,14 +1,45 @@
1
- # make sure our project's ./lib directory is added to the ruby search path
2
- $: << File.join(File.dirname(__FILE__),"lib")
1
+ require 'bundler'
2
+ require 'jeweler'
3
3
 
4
- require 'rubygems'
5
- require 'rake/gempackagetask'
6
- require 'rake/clean'
7
- require 'rake/rdoctask'
8
- require 'rake/contrib/sshpublisher'
4
+ begin
5
+ Bundler.setup(:default, :development)
6
+ rescue Bundler::BundlerError => e
7
+ $stderr.puts e.message
8
+ $stderr.puts "Run `bundle install` to install missing gems"
9
+ exit e.status_code
10
+ end
9
11
 
10
- require 'meimei'
12
+ Jeweler::Tasks.new do |gem|
13
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
14
+ gem.name = "meimei"
15
+ gem.homepage = "http://github.com/r888888888/meimei"
16
+ gem.license = "MIT"
17
+ gem.summary = %Q{Minimalistic IRC bot framework}
18
+ gem.description = %Q{If all you need is a simple infobot and don't need a full RFC1459 implementation.}
19
+ gem.email = "r888888888@gmail.com"
20
+ gem.authors = ["r888888888"]
21
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
22
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
23
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
24
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
11
27
 
12
- load 'tasks/setup.rb'
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
13
34
 
35
+ task :default => :test
14
36
 
37
+ require 'rdoc/task'
38
+ Rake::RDocTask.new do |rdoc|
39
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
40
+
41
+ rdoc.rdoc_dir = 'rdoc'
42
+ rdoc.title = "meimei #{version}"
43
+ rdoc.rdoc_files.include('README*')
44
+ rdoc.rdoc_files.include('lib/**/*.rb')
45
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.3.0
data/cron.sh ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+
3
+ PID=`pgrep -f run_meimei`
4
+
5
+ if [[ "$PID" == "" ]] ; then
6
+ cd /home/albert/meimei
7
+ ./run_meimei.rb &
8
+ fi
data/lib/meimei/client.rb CHANGED
@@ -118,7 +118,7 @@ module Meimei
118
118
  def check_command_plugins(msg)
119
119
  @command_plugins.each do |name, block, options|
120
120
  begin
121
- if name.index("!") == 0
121
+ if name =~ /^!/
122
122
  if msg =~ /^#{name}\b/
123
123
  msg = msg.gsub(/!\S+\s*/, "")
124
124
  block.call(msg)
@@ -154,18 +154,15 @@ module Meimei
154
154
  while @running
155
155
  @servers.each do |server|
156
156
  unless server.is_connected
157
- if server.reconnect_delay_passed? && server.connect()
157
+ if server.reconnect_delay_passed? && server.connect
158
158
  server.write("PASS #{@password}") if @password
159
159
  server.write("NICK #{@nick}")
160
160
  server.write("USER #{@username} hostname servername :#{@username}")
161
- server.autojoin.each do |channel|
162
- server.write("JOIN #{channel}")
163
- end
164
161
  end
165
162
  end
166
163
 
167
- self.autoping()
168
- self.check_timer_plugins()
164
+ autoping()
165
+ check_timer_plugins()
169
166
 
170
167
  @current_server = self.select()
171
168
 
@@ -173,7 +170,8 @@ module Meimei
173
170
  msg = @current_server.read
174
171
 
175
172
  if msg != nil
176
- self.process_message(msg)
173
+ autojoin_on_recognize(server, msg)
174
+ process_message(msg)
177
175
  end
178
176
  end
179
177
  end
@@ -211,6 +209,18 @@ module Meimei
211
209
  server.write("PRIVMSG #{to} :#{msg}")
212
210
  end
213
211
 
212
+ def autojoin_on_recognize(server, msg)
213
+ if msg =~ /^:\S+ MODE #{@nick} :\+r/
214
+ autojoin(server)
215
+ end
216
+ end
217
+
218
+ def autojoin(server)
219
+ server.autojoin.each do |channel|
220
+ server.write("JOIN #{channel}")
221
+ end
222
+ end
223
+
214
224
  # Parses a messages and dispatches as necessary.
215
225
  def process_message(msg)
216
226
  @current_from = nil
data/lib/meimei.rb CHANGED
@@ -1,25 +0,0 @@
1
- module Meimei
2
-
3
- ROOT_DIR = File.expand_path(File.join(File.dirname(__FILE__),".."))
4
- LIB_DIR = File.join(ROOT_DIR,"lib").freeze
5
- RESOURCE_DIR = File.join(ROOT_DIR,"resources").freeze
6
-
7
- #
8
- # Utility method to require all files ending in .rb in the directory
9
- # with the same name as this file minus .rb
10
- #
11
- def require_all_libs_relative_to(fname)
12
- prepend = File.basename(fname,".rb")
13
- search_me = File.join(File.dirname(fname),prepend)
14
-
15
- Dir.entries(search_me).each do |rb|
16
- if File.extname(rb) == ".rb" then
17
- require "#{prepend}/#{File.basename(rb,".rb")}"
18
- end
19
- end
20
- end
21
- module_function :require_all_libs_relative_to
22
-
23
- end
24
-
25
- Meimei.require_all_libs_relative_to(__FILE__)
data/plugins/an2.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'cgi'
2
+
3
+ define_plugin("!an2") do |msg|
4
+ reply "http://www.animenewsnetwork.com/encyclopedia/search/name?q=#{CGI.escape(msg)}"
5
+ end
data/plugins/ann.rb ADDED
@@ -0,0 +1,47 @@
1
+ require 'net/http'
2
+ require 'cgi'
3
+ require 'uri'
4
+ require 'timeout'
5
+
6
+ define_plugin("!ann") do |msg|
7
+ @ann_cache ||= {}
8
+
9
+ name = msg
10
+
11
+ if @ann_cache[name]
12
+ reply @ann_cache[name]
13
+ next
14
+ end
15
+
16
+ if name =~ /^(anime|manga|people|company) /
17
+ type = $1
18
+ name = name.gsub(/^(?:anime|manga|people|company) /, "")
19
+ else
20
+ type = "anime|manga|people|company"
21
+ end
22
+
23
+ uri = URI.parse("http://www.animenewsnetwork.com/encyclopedia/search.php?searchbox=#{CGI.escape(name)}")
24
+
25
+ begin
26
+ Net::HTTP.start("www.animenewsnetwork.com", 80) do |http|
27
+ resp = http.get("/encyclopedia/search/name?q=" + CGI.escape(name))
28
+ links = resp.body.scan(/<a href="\/encyclopedia\/(#{type})\.php\?id=(\d+)">(.+?)<\/a>/)
29
+ matches = []
30
+ links[0, 3].each do |l|
31
+ matches << "#{l[0]}.php?id=#{l[1]}"
32
+ end
33
+
34
+ if matches.any?
35
+ link = "http://www.animenewsnetwork.com/encyclopedia/#{matches[0]}"
36
+ @ann_cache[name] = link
37
+ reply link
38
+ else
39
+ reply "no matches found"
40
+ end
41
+ end
42
+ rescue Timeout
43
+ reply "timeout"
44
+ rescue Exception => e
45
+ reply e.to_s
46
+ end
47
+ end
@@ -0,0 +1,5 @@
1
+ define_plugin("@5m autoping") do
2
+ @servers.each do |server|
3
+ server.write("PING #{server.hostname}")
4
+ end
5
+ end
data/plugins/cco.rb ADDED
@@ -0,0 +1,4 @@
1
+ define_plugin("cco") do |msg|
2
+ next unless msg =~ /\bCCO\b/
3
+ reply "MAKOTO CCO YOUR HEAD BELONGS TO ME"
4
+ end
data/plugins/choose.rb ADDED
@@ -0,0 +1,13 @@
1
+ define_plugin("!choose") do |msg|
2
+ if rand(100) <= 2
3
+ reply "You decide."
4
+ else
5
+ choices = msg.split(/,\s*/)
6
+ special = choices.grep(/only everyone is/)
7
+ if special.any?
8
+ reply special.pick_random
9
+ else
10
+ reply choices.pick_random
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ define_plugin("courage") do |msg|
2
+ next unless msg =~ /the chance .+ is (?:only )?(\d+(?:\.\d+)?)%/i
3
+
4
+ if $1.to_f < 100
5
+ reply "WITH COURAGE WE CAN MAKE IT 100%!!", false
6
+ end
7
+ end
data/plugins/dan.rb ADDED
@@ -0,0 +1,13 @@
1
+ require 'uri'
2
+
3
+ define_plugin("!dan") do |msg|
4
+ tags = URI.escape(msg, /[^a-zA-Z0-9]/).gsub(/%20/, "+")
5
+
6
+ if rand(100) == 0
7
+ reply "WAKE UP"
8
+ sleep 1
9
+ reply "DAN!"
10
+ end
11
+
12
+ reply "http://danbooru.donmai.us/post?tags=#{tags}"
13
+ end
data/plugins/dg.rb ADDED
@@ -0,0 +1,25 @@
1
+ require 'rubygems'
2
+ require 'json'
3
+ require 'open-uri'
4
+ require 'cgi'
5
+ require 'pp'
6
+
7
+ define_plugin("!dg") do |msg|
8
+ api_key = CGI.escape("AIzaSyBbqMEONSx_cqrBhk0GXNbzZw_E3bNgNwQ")
9
+ cx = CGI.escape("003806434433967703265:4z2lw9zljym")
10
+ query = CGI.escape(msg)
11
+ url = "https://www.googleapis.com/customsearch/v1?key=#{api_key}&q=#{query}&cx=#{cx}"
12
+ text = open(url).read
13
+ json = JSON.parse(text)
14
+ urls = []
15
+
16
+ if json["items"]
17
+ urls = json["items"].select {|x| x["link"] =~ /us\/post/}.map {|x| x["link"]}
18
+ end
19
+
20
+ if urls.any?
21
+ reply urls.slice(0, 5).join(" | ")
22
+ else
23
+ reply "No matches"
24
+ end
25
+ end
data/plugins/dwiki.rb ADDED
@@ -0,0 +1,6 @@
1
+ require 'uri'
2
+
3
+ define_plugin("!dwiki") do |msg|
4
+ tags = URI.escape(msg, /[^a-zA-Z0-9]/).gsub(/%20/, "+")
5
+ reply "http://danbooru.donmai.us/wiki?query=#{tags}"
6
+ end
data/plugins/eta.rb ADDED
@@ -0,0 +1,43 @@
1
+ require 'rubygems'
2
+ require 'net/http'
3
+ require 'nokogiri'
4
+
5
+ define_plugin("!eta") do |msg|
6
+ query = msg
7
+
8
+ if query.strip == ""
9
+ reply "http://www.mahou.org/Showtime"
10
+ else
11
+ Net::HTTP.start("www.mahou.org", 80) do |http|
12
+ resp = http.get("/Showtime")
13
+ if resp.code !~ /200/
14
+ reply "Could not fetch web page, try again later"
15
+ break
16
+ end
17
+
18
+ answer = "Show not found"
19
+ doc = Nokogiri::HTML(resp.body)
20
+ doc.xpath('//table[@summary="Currently Airing"]/tr/td/table/tr').each do |element|
21
+ name = element.children[2].text
22
+ eta = element.children[12].text
23
+ if name =~ /#{query}/i
24
+ answer = "ETA for #{name}: #{eta}"
25
+ break
26
+ end
27
+ end
28
+
29
+ if answer == "Show not found"
30
+ doc.xpath('//table[@summary="Starting Soon"]/tr/td/table/tr').each do |element|
31
+ name = element.children[2].text
32
+ eta = element.children[16].text
33
+ if name =~ /#{query}/i
34
+ answer = "ETA for #{name}: #{eta}"
35
+ break
36
+ end
37
+ end
38
+ end
39
+
40
+ reply answer
41
+ end
42
+ end
43
+ end
data/plugins/g.rb ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "net/http"
5
+ require "uri"
6
+ require "json"
7
+ require "timeout"
8
+ require "cgi"
9
+
10
+ define_plugin("!g") do |msg|
11
+ query = msg
12
+
13
+ if query.any?
14
+ begin
15
+ Net::HTTP.start("ajax.googleapis.com", 80) do |http|
16
+ resp = http.get("/ajax/services/search/web?v=1.0&q=" + URI.escape(query, /./))
17
+ json = JSON.parse(resp.body)
18
+ answers = json["responseData"]["results"].map {|x| "\00311" + CGI.unescapeHTML(x["titleNoFormatting"]) + " \00307" + URI.unescape(x["url"])}
19
+ answers.each do |answer|
20
+ reply answer
21
+ end
22
+ end
23
+ rescue Timeout
24
+ reply "timeout"
25
+ rescue Exception => e
26
+ reply e.to_s
27
+ end
28
+ end
29
+ end
30
+
data/plugins/gc.rb ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "net/http"
5
+ require "uri"
6
+ require "json"
7
+ require "timeout"
8
+ require "cgi"
9
+
10
+ define_plugin("!gc") do |msg|
11
+ app = "meimei"
12
+ app_id = "WQJUTR-EXQT7VL45T"
13
+ url = URI.parse("http://api.wolframalpha.com/v2/query?input=#{CGI.escape(msg)}&appid=#{app_id}&format=plaintext&includepodid=Result")
14
+
15
+ begin
16
+ Net::HTTP.start(url.host, url.port) do |http|
17
+ resp = http.get(url.request_uri).body
18
+
19
+ if resp =~ /queryresult success='false'/
20
+ reply "Wolfram Alpha errored out"
21
+ elsif resp =~ /<plaintext>(.+?)<\/plaintext>/m
22
+ answer = $1.strip
23
+ answer = answer[0, 200]
24
+ reply "#{msg} -> #{answer}"
25
+ else
26
+ reply "Wolfram Alpha doesn't seem to know"
27
+ end
28
+ end
29
+ rescue Timeout
30
+ reply "timeout"
31
+ rescue Exception => e
32
+ reply e.to_s
33
+ end
34
+ end
@@ -0,0 +1,9 @@
1
+ define_plugin("god finger") do |msg|
2
+ next unless msg =~ /ore no kono te ga makka ni moeru/i
3
+
4
+ reply "Shouri o tsukameto todoroki sakebu!", false
5
+ sleep 1
6
+ reply "BAKUNETSU", false
7
+ sleep 1
8
+ reply "GOOOOOOOOOOOOOOOD FIIIIIIINGAAAAAAAAAAAAAA!!!!!!", false
9
+ end
@@ -0,0 +1,7 @@
1
+ define_plugin("hammer hell") do |msg|
2
+ next unless msg == "HAMMER HELL"
3
+
4
+ reply "HAMMER HEAVEN", false
5
+ sleep 1
6
+ reply "HIKARI NI NAAAAAAAAAAAAAAARRRRRRREEEEEEEEEEEEEEEEE", false
7
+ end
data/plugins/hanase.rb ADDED
@@ -0,0 +1,14 @@
1
+ define_plugin("hanase") do |msg|
2
+ @hanase ||= []
3
+ @hanase << msg
4
+
5
+ if @hanase.size > 3
6
+ @hanase.shift
7
+ end
8
+
9
+ if @hanase == %w(HA NA SE)
10
+ reply "nani kanchigai shiterunda."
11
+ sleep 2
12
+ reply "MADA ORE NO BATTLE PHASE WA SHUURYOU SHITENAIZE", false
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ define_plugin("hell and heaven") do |msg|
2
+ next unless msg == "HELL"
3
+ reply "ANDO", false
4
+ sleep 1
5
+ reply "HEAVEN!", false
6
+ end
data/plugins/help.rb ADDED
@@ -0,0 +1,7 @@
1
+ define_plugin("!help") do
2
+ a = "\00311"
3
+ b = "\00307"
4
+ c = "\00316"
5
+ reply "#{a}!ann !an2 #{b}Anime News Network Search #{c}| #{a}!g #{b}Google Search #{c}| #{a}!dan #{b}Danbooru Search #{c}| #{a}!tt !ttt #{b}Tokyo Toshokan Search #{c}| #{a}!choose #{b}Random Selection #{c}| #{a}!shuffle #{b}Random Order #{c}| #{a}!jtime #{b}Japanese Time #{c}| #{a}!gc #{b}Google Calculator #{c}| #{a}!ranking #{b}Rankings"
6
+ reply "#{a}!rs #{b}RapidSearch #{c}| #{a}!ts #{b}Twitter Search #{c}| #{a}!weather #{b}Weather #{c}| #{a}!eta #{b}Anime air dates #{c}| #{a}!dwiki #{b}Danbooru Wiki Search#{c}| #{a}!pixiv #{b}Pixiv English Search #{c}| #{a}!dg #{b}Danbooru Google Search#{c}"
7
+ end
data/plugins/jtime.rb ADDED
@@ -0,0 +1,9 @@
1
+ define_plugin("!jtime") do
2
+ Net::HTTP.start("www.google.com", 80) do |http|
3
+ resp = http.get("/search?q=tokyo+time")
4
+ html = resp.body
5
+ html =~ /<b>(\d+):(\d+)(am|pm)<\/b>/
6
+
7
+ reply "It is currently #{$1}:#{$2} #{$3} in Japan."
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ define_plugin("nai ja nai") do |msg|
2
+ next unless msg =~ /\bnai ja nai\b/i
3
+ reply "NAI JA NAI!!!", false
4
+ end
data/plugins/note.rb ADDED
@@ -0,0 +1,10 @@
1
+ =begin
2
+ define_plugin("!note") do |msg|
3
+ msg =~ /(\S+) (.+)/
4
+ dest = $1
5
+ note = $2
6
+
7
+ say @current_server, "MemoServ", "send #{dest} (from #{@current_from}) #{note}"
8
+ say @current_server, @current_from, "Forwarded note to #{dest}"
9
+ end
10
+ =end