This commit is contained in:
Jeremy Fincher 2003-09-29 05:51:28 +00:00
parent 14459d05d8
commit 2b6eb6665e

View File

@ -391,6 +391,22 @@ if __name__ == '__main__':
if yn('Would you like to add an owner user for your bot?') == 'y':
import ircdb
name = something('What should the owner\'s username be?')
try:
id = ircdb.users.getUserId(name)
u = ircdb.users.getUser(id)
if u.checkCapability('owner'):
myPrint("""That user already exists, and has owner capabilities
already. Perhaps you added it before? """)
if yn('Do you want to remove the its owner capability?')=='y':
u.removeCapability('owner')
ircdb.setUser(id, u)
else:
myPrint("""That user already exists, but doesn't have owner
capabilities.""")
if yn('Do you want to add to it owner capabilities?') == 'y':
u.addCapability('owner')
ircdb.setUser(id, u)
except KeyError:
password = something('What should the owner\'s password be?')
(id, u) = ircdb.users.newUser()
u.name = name