Give an appropriate error message when trying to Config.channel a non-channel-value.

This commit is contained in:
Jeremy Fincher 2004-08-08 17:36:08 +00:00
parent 2ebbc80a95
commit 5ec79236a3

View File

@ -169,6 +169,13 @@ class Config(callbacks.Privmsg):
configuration value of <name>. <channel> is only necessary if the configuration value of <name>. <channel> is only necessary if the
message isn't sent in the channel itself.""" message isn't sent in the channel itself."""
channel = privmsgs.getChannel(msg, args) channel = privmsgs.getChannel(msg, args)
if not args:
raise callbacks.ArgumentError
wrapper = getWrapper(args[0])
if not wrapper.channelValue:
irc.error('That configuration variable is not a channel-specific '
'configuration variable.')
return
components = registry.split(args[0]) components = registry.split(args[0])
components.append(channel) components.append(channel)
args[0] = registry.join(components) args[0] = registry.join(components)