mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-03 01:39:23 +01:00
Fix for bug #813150.
This commit is contained in:
parent
14459d05d8
commit
2b6eb6665e
@ -391,6 +391,22 @@ if __name__ == '__main__':
|
|||||||
if yn('Would you like to add an owner user for your bot?') == 'y':
|
if yn('Would you like to add an owner user for your bot?') == 'y':
|
||||||
import ircdb
|
import ircdb
|
||||||
name = something('What should the owner\'s username be?')
|
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?')
|
password = something('What should the owner\'s password be?')
|
||||||
(id, u) = ircdb.users.newUser()
|
(id, u) = ircdb.users.newUser()
|
||||||
u.name = name
|
u.name = name
|
||||||
|
Loading…
Reference in New Issue
Block a user