lib/protonbot/relay/plugin.rb in protonbot-relay-0.1.0 vs lib/protonbot/relay/plugin.rb in protonbot-relay-0.1.1
- old
+ new
@@ -55,14 +55,14 @@
bot.db_cross.query('relays').ensure.delete(to_del).write.finish
@relays.delete(to_del)
dat.nreply 'Done!'
end.perm!('manage-relays')
- core.help_add('relays', 'relayinfo', 'relayinfo (id)', 'Shows info about relay')
+ core.help_add('relays', 'relayinfo', 'relayinfo {id}', 'Shows info about relay')
cmd(cmd: 'relayinfo') do |dat|
if dat[:split].empty?
- dat.nreply ProtonBot::Bot::Messages::NOT_ENOUGH_PARAMETERS
+ dat.nreply "I have %B#{@relays.length}%N relays"
else
dat[:split].each do |id|
if @relays[id.to_i]
r = @relays[id.to_i]
s = "%C%BLUE#{r['p1']['server']}!#{r['p1']['channel']}%N <-> %C%PURPLE#{r['p2']['server']}!#{r['p2']['channel']}%N"
@@ -111,10 +111,10 @@
end
@relays.each_with_index do |v, k|
this, other = *getchan(dat, v)
if op = getop(this, other) and op.chans[other['channel']]
if dat[:cmd] == 'ACTION'
- op.privmsg(other['channel'], "%N[%Br#{k}%B]%N %B<%N#{dat[:nick]}%B>%N %C%BLUE* #{dat[:split].join(' ')}")
+ op.privmsg(other['channel'], "%N[%Br#{k}%B]%N %C%BLUE* #{dat[:nick]} #{dat[:split].join(' ')}")
else
op.privmsg(other['channel'], "%N[%Br#{k}%B]%N %B<%N#{dat[:nick]}%B>%N %C%BLUE[CTCP] #{dat[:message]}")
end
end
end
\ No newline at end of file