Sha256: 281392b98db673ce216388de0e11f766cd2965ca97ed02af887ac2f72e64de8e

Contents?: true

Size: 756 Bytes

Versions: 12

Compression:

Stored size: 756 Bytes

Contents

core.help_add('admin', 'join', 'join (chans|sep=,) [pass]', 'Joins given chans')
hook(type: :command, cmd: 'join') do |dat|
  if dat[:split].empty?
    m.nreply 'Not enough parameters!'
  else
    (pass = dat[:split][1]) || ''
    chans = dat[:split][0].split(',')
    chans.each do |chan|
      dat[:plug].join(chan, pass)
    end
  end
end.perm!('joinpart')

core.help_add('admin', 'part', 'part (chans|sep=,) [reason]', 'Parts given chans')
hook(type: :command, cmd: 'part') do |dat|
  if dat[:split].empty?
    dat[:plug].part(dat[:target], '')
  else
    reason = dat[:split][1,dat[:split].length-1].join(' ') || ''
    chans = dat[:split][0].split(',')
    chans.each do |chan|
      dat[:plug].part(chan, reason)
    end
  end
end.perm!('joinpart')

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
protonbot-0.3.7 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.3.6 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.3.5 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.3.4 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.3.3 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.3.2 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.3.1 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.3.0 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.2.7 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.2.6 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.2.5 lib/protonbot/core_plugin/commands/joinpart.rb
protonbot-0.2.4 lib/protonbot/core_plugin/commands/joinpart.rb