diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-07-29 11:08:32 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-07-29 11:08:32 +0000 |
commit | 08b62fa4b33ef08ddc2a98651438546529b6c449 (patch) | |
tree | 557763d3ea0e504a72adecedc86e53956c8dd7ef /lib/rbot | |
parent | ad6fbb82f84bb5f5c9bd58dbce9e7f70ae43908b (diff) |
User mode-checking methods now accept channel names and will try to resolve the corresponding Channel automatically
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/irc.rb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/rbot/irc.rb b/lib/rbot/irc.rb index 38c4a3e9..0edfb35a 100644 --- a/lib/rbot/irc.rb +++ b/lib/rbot/irc.rb @@ -971,15 +971,33 @@ module Irc end
def modes_on(channel)
- channel.modes_of(self)
+ case channel
+ when Channel
+ channel.modes_of(self)
+ else
+ return @server.channel(channel).modes_of(self) if @server
+ raise "Can't resolve channel #{channel}"
+ end
end
def is_op?(channel)
- channel.has_op?(self)
+ case channel
+ when Channel
+ channel.has_op?(self)
+ else
+ return @server.channel(channel).has_op?(self) if @server
+ raise "Can't resolve channel #{channel}"
+ end
end
def is_voice?(channel)
- channel.has_voice?(self)
+ case channel
+ when Channel
+ channel.has_voice?(self)
+ else
+ return @server.channel(channel).has_voice?(self) if @server
+ raise "Can't resolve channel #{channel}"
+ end
end
end
|