mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-04 00:24:11 +01:00
supybot-wizard: Fix handling of channel keys.
The keys should be in a separate configuration variable, not be concatenated with the channels themselves.
This commit is contained in:
parent
88d0a3a79f
commit
19f9604851
@ -534,9 +534,23 @@ def main():
|
|||||||
by a comma. For example:
|
by a comma. For example:
|
||||||
#supybot-bots #mychannel,mykey #otherchannel""");
|
#supybot-bots #mychannel,mykey #otherchannel""");
|
||||||
while True:
|
while True:
|
||||||
channels = something('What channels?', default=defaultChannels)
|
channels_input = something('What channels?', default=defaultChannels)
|
||||||
|
channels = []
|
||||||
|
for channel in channels_input.split():
|
||||||
|
L = channel.split(',')
|
||||||
|
if len(L) == 0:
|
||||||
|
continue
|
||||||
|
elif len(L) == 1:
|
||||||
|
(channel,) = L
|
||||||
|
channels.append(channel)
|
||||||
|
elif len(L) == 2:
|
||||||
|
(channel, key) = L
|
||||||
|
channels.append(channel)
|
||||||
|
network.channels.key.get(channel).setValue(key)
|
||||||
|
else:
|
||||||
|
output("""Too man commas in %s.""" % channel)
|
||||||
try:
|
try:
|
||||||
network.channels.set(channels)
|
network.channels.set(' '.join(channels))
|
||||||
break
|
break
|
||||||
except registry.InvalidRegistryValue as e:
|
except registry.InvalidRegistryValue as e:
|
||||||
output(""""%s" is an invalid IRC channel. Be sure to prefix
|
output(""""%s" is an invalid IRC channel. Be sure to prefix
|
||||||
|
Loading…
Reference in New Issue
Block a user