termtter 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/.gitignore +5 -0
  2. data/README.rdoc +2 -2
  3. data/Rakefile +41 -75
  4. data/VERSION +1 -0
  5. data/bin/termtter +9 -2
  6. data/doc/Termtter-1.0-Release-Note-English.txt +37 -0
  7. data/doc/Termtter-1.0-Release-Note.txt +37 -0
  8. data/lib/plugins/another_prompt.rb +8 -8
  9. data/lib/plugins/ar.rb +102 -0
  10. data/lib/plugins/async.rb +1 -1
  11. data/lib/plugins/babelfish.rb +34 -0
  12. data/lib/plugins/confirm.rb +2 -0
  13. data/lib/plugins/crypt.rb +44 -0
  14. data/lib/plugins/defaults/auto_reload.rb +1 -1
  15. data/lib/plugins/defaults/command_line.rb +34 -17
  16. data/lib/plugins/defaults/confirm.rb +30 -0
  17. data/lib/plugins/defaults/hashtag.rb +1 -1
  18. data/lib/plugins/defaults/irb.rb +30 -0
  19. data/lib/plugins/defaults/keyword.rb +58 -0
  20. data/lib/plugins/defaults/list.rb +155 -0
  21. data/lib/plugins/defaults/plugin.rb +59 -0
  22. data/lib/plugins/defaults/retweet.rb +75 -23
  23. data/lib/plugins/defaults/standard_commands.rb +60 -87
  24. data/lib/plugins/defaults/standard_completion.rb +25 -15
  25. data/lib/plugins/defaults/stdout.rb +49 -10
  26. data/lib/plugins/defaults/switch.rb +1 -1
  27. data/lib/plugins/defaults/users.rb +63 -0
  28. data/lib/plugins/draft.rb +58 -0
  29. data/lib/plugins/expand-tinyurl.rb +5 -9
  30. data/lib/plugins/favotter.rb +1 -1
  31. data/lib/plugins/footer.rb +22 -0
  32. data/lib/plugins/friends.rb +5 -4
  33. data/lib/plugins/g.rb +9 -16
  34. data/lib/plugins/gem_install.rb +24 -0
  35. data/lib/plugins/gist.rb +20 -0
  36. data/lib/plugins/grass.rb +1 -1
  37. data/lib/plugins/gyazo.rb +78 -0
  38. data/lib/plugins/http_server.rb +1 -1
  39. data/lib/plugins/hugeurl.rb +6 -13
  40. data/lib/plugins/irc_gw.rb +15 -11
  41. data/lib/plugins/me.rb +1 -1
  42. data/lib/plugins/notify-send.rb +1 -1
  43. data/lib/plugins/notify-send3.rb +1 -1
  44. data/lib/plugins/open.rb +1 -1
  45. data/lib/plugins/open_url.rb +5 -1
  46. data/lib/plugins/pool.rb +1 -1
  47. data/lib/plugins/random.rb +1 -1
  48. data/lib/plugins/reply_retweet.rb +42 -0
  49. data/lib/plugins/screen-notify.rb +1 -1
  50. data/lib/plugins/sl.rb +3 -3
  51. data/lib/plugins/storage.rb +7 -10
  52. data/lib/plugins/storage/sqlite3.rb +155 -0
  53. data/lib/plugins/storage/status.rb +2 -0
  54. data/lib/plugins/stream.rb +1 -1
  55. data/lib/plugins/tinyurl.rb +3 -9
  56. data/lib/plugins/trends.rb +2 -2
  57. data/lib/plugins/truncate.rb +1 -1
  58. data/lib/plugins/w3mimg.rb +1 -1
  59. data/lib/termtter.rb +19 -20
  60. data/lib/termtter/active_rubytter.rb +4 -0
  61. data/lib/termtter/api.rb +22 -5
  62. data/lib/termtter/client.rb +55 -40
  63. data/lib/termtter/command.rb +3 -2
  64. data/lib/termtter/config_setup.rb +1 -1
  65. data/lib/termtter/config_template.erb +5 -0
  66. data/lib/termtter/default_config.rb +18 -0
  67. data/lib/termtter/hookable.rb +1 -0
  68. data/lib/termtter/httppool.rb +44 -0
  69. data/lib/termtter/memory_cache.rb +32 -0
  70. data/lib/termtter/optparse.rb +8 -15
  71. data/lib/termtter/rubytter_proxy.rb +65 -4
  72. data/lib/termtter/system_extensions.rb +40 -9
  73. data/lib/termtter/task.rb +2 -1
  74. data/spec/plugins/defaults/hashtag_spec.rb +8 -7
  75. data/spec/plugins/defaults/list_spec.rb +33 -0
  76. data/spec/plugins/defaults/plugin_spec.rb +17 -0
  77. data/spec/plugins/defaults/retweet_spec.rb +205 -0
  78. data/spec/plugins/draft_spec.rb +59 -0
  79. data/spec/plugins/expand-tinyurl_spec.rb +21 -0
  80. data/spec/plugins/footer_spec.rb +50 -0
  81. data/spec/plugins/storage/sqlite3_spec.rb +41 -0
  82. data/spec/termtter/api_spec.rb +1 -1
  83. data/spec/termtter/client_spec.rb +21 -21
  84. data/spec/termtter/command_spec.rb +8 -8
  85. data/spec/termtter/config_spec.rb +2 -2
  86. data/spec/termtter/memory_cache_spec.rb +20 -0
  87. data/spec/termtter/optparse_spec.rb +1 -1
  88. data/spec/termtter/rubytter_proxy_spec.rb +38 -0
  89. data/spec/termtter/system_extensions_spec.rb +25 -23
  90. data/spec/termtter/task_manager_spec.rb +1 -1
  91. data/spec/termtter_spec.rb +4 -2
  92. metadata +88 -19
  93. data/lib/plugins/defaults/lists.rb +0 -14
  94. data/lib/plugins/irb.rb +0 -6
  95. data/lib/plugins/storage/DB.rb +0 -37
  96. data/lib/termtter/version.rb +0 -4
  97. data/spec/plugins/defaults/lists_spec.rb +0 -34
  98. data/spec/plugins/storage/DB_spec_.rb +0 -12
@@ -23,7 +23,7 @@ module Termtter::Client
23
23
  end
24
24
 
25
25
  Termtter::API.setup
26
- call_commands('reload')
26
+ execute('reload')
27
27
  },
28
28
  :help => ["switch USERNAME", "Switch twitter account."]
29
29
  )
@@ -0,0 +1,63 @@
1
+ module Termtter::Client
2
+ register_command(
3
+ :profile,
4
+ :aliases => [:p],
5
+ :help => ["user show USERNAME/[SLUG]", "Show user's profile."]
6
+ ) do |arg|
7
+ user_name = arg.empty? ? config.user_name : arg
8
+ if user_name =~ /\//
9
+ user_name, slug = *user_name.split('/')
10
+ user_name = normalize_as_user_name(user_name)
11
+ list = Termtter::API.twitter.list(user_name, slug)
12
+ attrs = %w[ full_name slug description mode id member_count subscriber_count]
13
+ label_width = attrs.map(&:size).max
14
+ attrs.each do |attr|
15
+ value = list.__send__(attr.to_sym)
16
+ puts "#{attr.gsub('_', ' ').rjust(label_width)}: #{value}"
17
+ end
18
+ else
19
+ user = Termtter::API.twitter.user(user_name)
20
+ attrs = %w[ name screen_name url description profile_image_url location protected following
21
+ friends_count followers_count statuses_count favourites_count
22
+ id time_zone created_at utc_offset notifications
23
+ ]
24
+ label_width = attrs.map(&:size).max
25
+ attrs.each do |attr|
26
+ value = user.__send__(attr.to_sym)
27
+ puts "#{attr.gsub('_', ' ').rjust(label_width)}: #{value}"
28
+ end
29
+ end
30
+ end
31
+
32
+ class UserSearchEvent; attr_reader :query; def initialize(query); @query = query end; end
33
+
34
+ register_command(
35
+ 'user search',
36
+ :help => ["user search QUERY", "search users"]
37
+ ) do |arg|
38
+ search_option = config.user_search.option.empty? ? {} : config.user_search.option
39
+ statuses = Termtter::API.twitter.search_user(arg, search_option)
40
+ results = []
41
+ statuses.select{|s| s.status != nil }.map do |s|
42
+ result = {
43
+ :id => s.status.id,
44
+ :text => s.status.text,
45
+ :in_reply_to_status_id => s.in_reply_to_status_id,
46
+ :created_at => s.created_at,
47
+ :user => {:id => s.id, :name => s.name, :screen_name => s.screen_name}
48
+ }
49
+ results << Rubytter.structize(result)
50
+ end
51
+ output(results, UserSearchEvent.new(arg))
52
+ end
53
+
54
+ register_hook(:highlight_for_user_search, :point => :pre_coloring) do |text, event|
55
+ case event
56
+ when UserSearchEvent
57
+ query = event.query.split(/\s/).map {|q|Regexp.quote(q)}.join("|")
58
+ text.gsub(/(#{query})(.*:)/i, '<on_magenta><white>\1</white></on_magenta>\2')
59
+ else
60
+ text
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,58 @@
1
+ config.plugins.draft.set_default(:ignore, [/^(reload\s+\-r|draft)/])
2
+
3
+ def list_drafts(drafts)
4
+ drafts.each_with_index do |draft, index|
5
+ puts "#{index}: #{draft}"
6
+ end
7
+ end
8
+
9
+ def get_draft_index(arg)
10
+ case arg
11
+ when /^\d+$/
12
+ arg.to_i
13
+ when ''
14
+ -1
15
+ else
16
+ nil
17
+ end
18
+ end
19
+
20
+ module Termtter::Client
21
+ public_storage[:drafts] ||= []
22
+
23
+ register_hook(:save_as_draft, :point => :timeout) do |input_text|
24
+ if !config.plugins.draft.ignore.any? {|pattern| pattern =~ input_text} &&
25
+ public_storage[:drafts].last != input_text
26
+ public_storage[:drafts] << input_text
27
+ puts "Save as draft: #{input_text}"
28
+ end
29
+ end
30
+
31
+ register_command('draft list') do |arg|
32
+ list_drafts(public_storage[:drafts])
33
+ end
34
+
35
+ register_command('draft exec') do |arg|
36
+ index = get_draft_index(arg)
37
+ if index
38
+ command = public_storage[:drafts][index]
39
+ if command
40
+ puts "exec => \"#{command}\""
41
+ execute(public_storage[:drafts][index])
42
+ public_storage[:drafts].delete_at(index)
43
+ end
44
+ end
45
+ end
46
+
47
+ register_command('draft delete') do |arg|
48
+ index = get_draft_index(arg)
49
+ if index
50
+ deleted = public_storage[:drafts].delete_at(index)
51
+ puts "deleted => \"#{deleted}\"" if deleted
52
+ end
53
+ end
54
+
55
+ register_command('draft clear') do |arg|
56
+ public_storage[:drafts].clear
57
+ end
58
+ end
@@ -5,8 +5,8 @@ URL_SHORTTERS = [
5
5
  { :host => "is.gd", :pattern => %r'(http://is\.gd(/[\w/]+))' },
6
6
  { :host => "bit.ly", :pattern => %r'(http://bit\.ly(/[\w/]+))' },
7
7
  { :host => "ff.im", :pattern => %r'(http://ff\.im(/[-\w/]+))'},
8
- { :host => "to.ly", :pattern => %r'(http://to\.ly(/[-\w/]+))'},
9
8
  { :host => "j.mp", :pattern => %r'(http://j\.mp(/[\w/]+))' },
9
+ { :host => "goo.gl", :pattern => %r'(http://goo\.gl(/[\w/]+))' },
10
10
  ]
11
11
 
12
12
  config.plugins.expand_tinyurl.set_default(:shortters, [])
@@ -44,16 +44,12 @@ Termtter::Client::register_hook(
44
44
  )
45
45
 
46
46
  def expand_url(host, path)
47
- http_class = Net::HTTP
48
- unless config.proxy.host.nil? or config.proxy.host.empty?
49
- http_class = Net::HTTP::Proxy(config.proxy.host,
50
- config.proxy.port,
51
- config.proxy.user_name,
52
- config.proxy.password)
47
+ res = Termtter::HTTPpool.start(host) do |h|
48
+ h.get(path, { 'User-Agent' => 'Mozilla' })
53
49
  end
54
- res = http_class.new(host).get(path, { 'User-Agent' => 'Mozilla' })
55
50
  return nil unless res.code == "301" or res.code == "302"
56
51
  res['Location'].force_encoding(Encoding::UTF_8)
57
- rescue
52
+ rescue Exception => e
53
+ Termtter::Client.handle_error(e)
58
54
  nil
59
55
  end
@@ -70,7 +70,7 @@ module Termtter::Client
70
70
  register_command('favotter_fav', :alias => :ffav, :help => help) do |arg|
71
71
  raise 'need favorited_id' if arg.empty?
72
72
  if id = public_storage[:favorited_ids][arg]
73
- call_commands("favorite #{id}")
73
+ execute("favorite #{id}")
74
74
  end
75
75
  end
76
76
  end
@@ -0,0 +1,22 @@
1
+ #-*- coding: utf-8 -*-
2
+
3
+ config.set_default('footer',nil)
4
+
5
+ Termtter::Client.register_hook(
6
+ :name => :add_footer,
7
+ :points => [:modify_arg_for_update, :modify_arg_for_reply],
8
+ :exec => lambda {|cmd, arg|
9
+ (config.footer.nil? || config.footer.empty?) ? arg : arg + " #{config.footer}"
10
+ }
11
+ )
12
+
13
+ Termtter::Client.register_command(
14
+ :name => :footer,
15
+ :aliases => [:ft],
16
+ :exec => lambda {|arg|
17
+ arg.empty? ? config.footer = nil : config.footer = arg
18
+ puts config.footer.nil? ? "footer is turned off" : "new footer=> #{config.footer}"
19
+ }
20
+ )
21
+
22
+
@@ -4,13 +4,14 @@ module Termtter::Client
4
4
  class << self
5
5
  def get_friends(user_name, max)
6
6
  friends = []
7
- page = 0
7
+ cursor = -1
8
8
  begin
9
- friends += tmp = Termtter::API::twitter.friends(user_name,
10
- :page => page += 1)
9
+ tmp = Termtter::API::twitter.friends(user_name, :cursor => cursor)
10
+ cursor = tmp[:next_cursor]
11
+ friends += tmp[:users]
11
12
  puts "#{friends.length}/#{max}"
12
13
  rescue
13
- end until (tmp.empty? or friends.length > max)
14
+ end until (cursor.zero? or friends.length > max)
14
15
  friends.take(max)
15
16
  end
16
17
  end
data/lib/plugins/g.rb CHANGED
@@ -1,16 +1,9 @@
1
- module Termtter::Client
2
- begin
3
- require 'g'
4
- register_command(
5
- :name => :g,
6
- :help => ['g obj', "Do you know 'g'? It's like 'p'."],
7
- :exec_proc => lambda {|arg|
8
- # we get arg as String, so without eval() it is not very useful
9
- # but we shouldn't blindly eval user-supplied string like this, either
10
- g eval(arg)
11
- }
12
- )
13
- rescue e
14
- handle_error(e)
15
- end
16
- end
1
+ require 'g'
2
+ Termtter::Client.register_command(
3
+ :g,
4
+ :help => ['g OBJECT', "Do you know 'g'? It's like 'p'."]
5
+ ) do |arg|
6
+ # we get arg as String, so without eval() it is not very useful
7
+ # but we shouldn't blindly eval user-supplied string like this, either
8
+ g eval(arg)
9
+ end
@@ -0,0 +1,24 @@
1
+ # Plugin gem_install
2
+ # AUTHOR: Tatsuhiro Ujihisa <http://ujihisa.blogspot.com/>
3
+ # SYNOPSIS:
4
+ # Once you use this plugin by `plug gem_install`, your termtter will
5
+ # install arbitrary gem libraries when they appeared on your timeline,
6
+ # replies or anything on your termtter.
7
+ # How useful it is.
8
+ # If you already have `g`, the automatic installation will be announced
9
+ # on your Growl.
10
+ Termtter::Client.register_hook(
11
+ :name => :gem_install,
12
+ :points => [:output],
13
+ :exec_proc => lambda {|statuses, _|
14
+ statuses.each do |s|
15
+ /gem install ([a-zA-Z0-9_\-]+)/ =~ s.text
16
+ if gem_name = $1
17
+ (private_methods.map(&:to_sym).include?(:g) ? method(:g) : method(:p)).
18
+ call("Termtter's `gem_install` plugin is now installing #{gem_name}")
19
+ fork do
20
+ system 'gem', 'install', gem_name
21
+ end
22
+ end
23
+ end
24
+ })
@@ -0,0 +1,20 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ Termtter::Client.register_command(
4
+ :name => :gist,
5
+ :exec => lambda {|arg|
6
+ args = arg.split(' ')
7
+ output = args[0] == '-p' ?
8
+ `#{args[1..-1].join(' ')} | gist -p` :
9
+ `#{args.join(' ')} | gist`
10
+ Termtter::API.twitter.update(output)
11
+ puts "=> " <<output
12
+ }
13
+ )
14
+
15
+ # gist.rb : Executes command and creates gist with the output
16
+ # Depends on : http://github.com/defunkt/gist
17
+ # Usage : gist command_to_execute
18
+ # Examples :
19
+ # > gist ls (public gist)
20
+ # > gist -p ifconfig (private gist)
data/lib/plugins/grass.rb CHANGED
@@ -12,7 +12,7 @@ module Termtter
12
12
  rate ||= config.plugins.grass.rate
13
13
  grow = (count * rate.to_i).quo(100).round
14
14
  grasses = ('w' * (count-grow) + 'W' * grow).split(//).shuffle.join
15
- call_commands("update #{grasses}")
15
+ execute("update #{grasses}")
16
16
  },
17
17
  :help => ['grass, w', 'Grass it!']
18
18
  )
@@ -0,0 +1,78 @@
1
+ require 'net/http'
2
+
3
+ def post_gyazo
4
+ browser_cmd = 'firefox'
5
+ gyazo_url = ""
6
+
7
+ idfile = ENV['HOME'] + "/.gyazo.id"
8
+
9
+ id = ''
10
+ if File.exist?(idfile) then
11
+ id = File.read(idfile).chomp
12
+ else
13
+ id = Time.new.strftime("%Y%m%d%H%M%S")
14
+ File.open(idfile,"w").print(id+"\n")
15
+ end
16
+
17
+ tmpfile = "/tmp/image_upload#{$$}.png"
18
+
19
+ system "import #{tmpfile}"
20
+
21
+ imagedata = File.read(tmpfile)
22
+ File.delete(tmpfile)
23
+
24
+ boundary = '----BOUNDARYBOUNDARY----'
25
+
26
+ data = <<EOF
27
+ --#{boundary}\r
28
+ content-disposition: form-data; name="id"\r
29
+ \r
30
+ #{id}\r
31
+ --#{boundary}\r
32
+ content-disposition: form-data; name="imagedata"\r
33
+ \r
34
+ #{imagedata}\r
35
+ \r
36
+ --#{boundary}--\r
37
+ EOF
38
+
39
+ header ={
40
+ 'Content-Length' => data.length.to_s,
41
+ 'Content-type' => "multipart/form-data; boundary=#{boundary}"
42
+ }
43
+
44
+ Net::HTTP.start("gyazo.com",80){|http|
45
+ res = http.post("/upload.cgi",data,header)
46
+ url = res.response.to_ary[1]
47
+ puts url
48
+ system "#{browser_cmd} #{url}"
49
+ gyazo_url = url
50
+ }
51
+ return gyazo_url
52
+ end
53
+
54
+ Termtter::Client.register_command(
55
+ :name => :gyazo,
56
+ :help => ['gyazo comment', 'upload a captured image'],
57
+ :exec => lambda {|arg|
58
+ text = arg
59
+ url = post_gyazo
60
+ Termtter::API.twitter.update(text + " " + url)
61
+ puts "=> " << text + " " + url
62
+ }
63
+ )
64
+
65
+ # gyazo:
66
+ # Capture an arbitary desktop area and upload the image to gyazo.com,
67
+ # open it up with the browser you specified. Then, tweet the link with
68
+ # a message.
69
+ #
70
+ # You need ImageMagick tools and a web browser(default:Firefox, as you
71
+ # can see.)
72
+ #
73
+ # thanks to:
74
+ # http://yaa.no-ip.org/~yaa/diary/20071108.html#p04
75
+ #
76
+ # example:
77
+ # gyazo What a lame dialogue message! (capture process starts...)
78
+ #
@@ -66,7 +66,7 @@ module Termtter::Client
66
66
  @http_server_output = ''
67
67
  begin
68
68
  command = req.path.sub(/^\//, '')
69
- call_commands(command)
69
+ execute(command)
70
70
  res['Content-Type'] = 'text/javascript; charset=utf-8';
71
71
  res.body = @http_server_output
72
72
  rescue Termtter::CommandNotFound => e
@@ -14,20 +14,13 @@ Termtter::Client::register_hook(
14
14
  :name => :hugeurl,
15
15
  :point => :filter_for_output,
16
16
  :exec_proc => lambda do |statuses, event|
17
- http_class = Net::HTTP
18
- unless config.proxy.host.nil? or config.proxy.host.empty?
19
- http_class = Net::HTTP::Proxy(config.proxy.host,
20
- config.proxy.port,
21
- config.proxy.user_name,
22
- config.proxy.password)
23
- end
24
- http_class.start('search.twitter.com') do |http|
25
- statuses.each do |s|
26
- config.plugins.hugeurl.skip_users.include?(s.user.screen_name) and next
27
- s.text.gsub!(HUGEURL_TARGET_PATTERN) do |m|
28
- res = http.get('/hugeurl?url=' + m)
29
- res.code == '200' && res.body !~ /^</ ? res.body : m
17
+ statuses.each do |s|
18
+ config.plugins.hugeurl.skip_users.include?(s.user.screen_name) and next
19
+ s.text.gsub!(HUGEURL_TARGET_PATTERN) do |m|
20
+ res = Termtter::HTTPpool.start('search.twitter.com') do |h|
21
+ h.get('/hugeurl?url=' + m)
30
22
  end
23
+ res.code == '200' && res.body !~ /^</ ? res.body : m
31
24
  end
32
25
  end
33
26
  statuses
@@ -10,12 +10,16 @@ module Termtter::Client
10
10
  class << self
11
11
  def following_friends
12
12
  user_name = config.user_name
13
-
14
- frinends = []
15
- page = 0
13
+ frinends = []
14
+ last = nil
16
15
  begin
17
- frinends += tmp = Termtter::API::twitter.friends(user_name, :page => page+=1)
18
- end until tmp.empty?
16
+ puts "collecting friends (#{frinends.length})"
17
+ last = Termtter::API::twitter.friends(user_name, :cursor => last ? last.next_cursor : -1)
18
+ frinends += last.users
19
+ rescue Timeout::Error, StandardError # XXX
20
+ break
21
+ end until last.next_cursor == 0
22
+ puts "You have #{frinends.length} friends."
19
23
  frinends.map(&:screen_name)
20
24
  end
21
25
  end
@@ -42,7 +46,7 @@ class TermtterIrcGateway < Net::IRC::Server::Session
42
46
  if Termtter::Client.respond_to? :register_output
43
47
  Termtter::Client.register_output(:irc) do |message|
44
48
  @@listners.each do |listener|
45
- listener.log(message.gsub(/\e\[\d+m/, '')) # remove escape sequence
49
+ listener.log(message.to_s.gsub(/\e\[\d+m/, '')) # remove escape sequence
46
50
  end
47
51
  end
48
52
  end
@@ -74,9 +78,9 @@ class TermtterIrcGateway < Net::IRC::Server::Session
74
78
 
75
79
  def on_message(m)
76
80
  termtter_command = m.command.downcase + ' ' + m.params.join(' ')
77
- return if Termtter::Client.find_commands(termtter_command).empty?
81
+ return unless Termtter::Client.find_command(termtter_command)
78
82
  post '#termtter', NOTICE, main_channel, '> ' + termtter_command
79
- Termtter::Client.call_commands(termtter_command)
83
+ Termtter::Client.execute(termtter_command)
80
84
  rescue Exception => e
81
85
  post '#termtter', NOTICE, main_channel, "#{e.class.to_s}: #{e.message}"
82
86
  Termtter::Client.handle_error(e)
@@ -94,11 +98,11 @@ class TermtterIrcGateway < Net::IRC::Server::Session
94
98
  target, message = *m.params
95
99
  if message =~ / +\//
96
100
  termtter_command = message.gsub(/ +\//, '')
97
- return if Termtter::Client.find_commands(termtter_command).empty?
101
+ return unless Termtter::Client.find_command(termtter_command)
98
102
  post '#termtter', NOTICE, main_channel, '> ' + termtter_command
99
- Termtter::Client.call_commands(termtter_command)
103
+ Termtter::Client.execute(termtter_command)
100
104
  else
101
- Termtter::Client.call_commands('update ' + message)
105
+ Termtter::Client.execute('update ' + message)
102
106
  post @prefix, TOPIC, main_channel, message
103
107
  end
104
108
  rescue Exception => e