protonbot 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dc988d20d75650203519befc6557450026fe5f3
4
- data.tar.gz: c770acdac3ffa5a6bde08949ec8571dd872d1cf0
3
+ metadata.gz: 61920b192eecbc9b7b39d4bf03bba247b78bcdbd
4
+ data.tar.gz: 958c3b77f8f26d0645dae278922f1da6fdefeb70
5
5
  SHA512:
6
- metadata.gz: 4e47035c9ed7843536074ccb89df051fada5a71c84600bbae24f6a250add07df866b29303b68c7c48647f83207012e826220610a6fc73583ebd0000016cae7b0
7
- data.tar.gz: 306f4b16d3433b74fc9381931d120761087464a33ca636a78d7f0a85066fc12c6720fe6ce26ce903bde24a0a762ae903c768726a20e047a98eb1ac7194cd94cd
6
+ metadata.gz: 0d9310723a7ad08d58fe08cc6d62a636c13f7f38f851e7e7f5823c2efa8543666427ade1470e09c8f58d0d073fbc4e0d2333e93fbea5bb9ed3bdb5d7f3973de3
7
+ data.tar.gz: b5def97b97faa11db2d4f485c79b9c760d5698f0a0913d6b555d68640832f555edb8fa6e4b2f81d81091b2562ed760f3ca518a6459b6c984120f43e23f4473a4
@@ -44,8 +44,9 @@ class ProtonBot::Bot
44
44
  @plugin_loader.call if @plugin_loader
45
45
  @plugins.each do |k, v|
46
46
  v.bot = self
47
- v.log = @_log.wrap("?#{k}")
48
47
  v.launch
48
+ v.log = @_log.wrap("?#{v.name}")
49
+ v.log.info("Started plugin `#{v.name} v#{v.version}` successfully!")
49
50
  end
50
51
  self
51
52
  end
@@ -11,24 +11,32 @@ fun :help_render do |query = nil, ehash = nil|
11
11
  p.hooks.each do |hk|
12
12
  next if hook
13
13
  next unless hk
14
- if hk.pattern[:type] == :command && hk.pattern[:cmd] == h[:name] && hk.extra[:needed_perms]
14
+ if hk.pattern[:type] == :command && hk.pattern[:cmd] == h[:name]
15
15
  hook = hk
16
16
  end
17
17
  end
18
18
  end
19
- done =
20
- if hook && ehash && ehash[:perms]
21
- perms = ehash[:perms]
22
- needed = hook.extra[:needed_perms]
23
- not_enough = needed - perms
24
- available = needed - not_enough
25
- available_ = available.map{|i|'%C%GREEN' + i + '%N'}
26
- not_enough_ = not_enough.map{|i|'%C%RED' + i + '%N'}
27
- permstatus = (available_ + not_enough_).join(' ')
28
- "%B#{group}/#{item} |%N #{h[:syntax]} %B|%N Perms: #{permstatus} %B|%N #{h[:description]}"
29
- else
30
- "%B#{group}/#{item} |%N #{h[:syntax]} %B|%N #{h[:description]}"
31
- end
19
+ done = "%B#{group}/#{item} |%N #{h[:syntax]} %B|%N #{h[:description]}"
20
+ if hook && ehash && ehash[:perms] && hook.extra[:needed_perms]
21
+ perms = ehash[:perms]
22
+ needed = hook.extra[:needed_perms]
23
+ not_enough = needed - perms
24
+ available = needed - not_enough
25
+ available_ = available.map{|i|'%C%GREEN' + i + '%N'}
26
+ not_enough_ = not_enough.map{|i|'%C%RED' + i + '%N'}
27
+ permstatus = (available_ + not_enough_).join(' ')
28
+ done << " %B|%N Perms: #{permstatus}"
29
+ end
30
+ if hook && ehash && hook.extra[:cooldown_seconds]
31
+ s = hook.extra[:cooldown_seconds].to_s
32
+ q =
33
+ if hook.extra[:cooldown_mode]
34
+ ''
35
+ else
36
+ ' (quiet)'
37
+ end
38
+ done << " %B|%N Cooldown: #{s}s#{q}"
39
+ end
32
40
  end
33
41
  end
34
42
  if done
@@ -7,3 +7,4 @@ hook(type: :code, code: @numeric::WHOISUSER) do |dat|
7
7
  u[:host] = m[3]
8
8
  emit(dat.merge(type: :code_whoisuser, nick: u[:nick], user: u[:user], host: u[:host]))
9
9
  end
10
+
@@ -1,3 +1,5 @@
1
+ require 'yaml'
2
+
1
3
  ProtonBot::Plugin.new do
2
4
  @name = 'Core'
3
5
  @version = ProtonBot::VERSION
@@ -41,7 +41,6 @@ class ProtonBot::Plugin
41
41
  @description
42
42
  raise ProtonBot::PluginError, 'Plugin-description is not set!' unless
43
43
  @description
44
- log.info("Started plugin `#{@name} v#{@version}` successfully!")
45
44
  end
46
45
 
47
46
  # Creates hook and returns it
@@ -1,4 +1,4 @@
1
1
  module ProtonBot
2
2
  # ProtonBot's version
3
- VERSION = '0.3.1'.freeze
3
+ VERSION = '0.3.2'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protonbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nickolay Ilyushin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-06 00:00:00.000000000 Z
11
+ date: 2017-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler