Fixed so CmdIRC2chan correctly handles deletion by botname and not just by dbref. Resolves #572.
This commit is contained in:
parent
81a18ab340
commit
f35b5e2038
1 changed files with 8 additions and 6 deletions
|
|
@ -758,12 +758,13 @@ class CmdIRC2Chan(MuxCommand):
|
||||||
Usage:
|
Usage:
|
||||||
@irc2chan[/switches] <evennia_channel> = <ircnetwork> <port> <#irchannel> <botname>
|
@irc2chan[/switches] <evennia_channel> = <ircnetwork> <port> <#irchannel> <botname>
|
||||||
@irc2chan/list
|
@irc2chan/list
|
||||||
@irc2chan/delete botname|dbid
|
@irc2chan/delete botname|#dbid
|
||||||
|
|
||||||
Switches:
|
Switches:
|
||||||
/disconnect - this will delete the bot and remove the irc connection
|
/delete - this will delete the bot and remove the irc connection
|
||||||
to the channel.
|
to the channel.
|
||||||
/remove - "
|
/remove - "
|
||||||
|
/disconnect - "
|
||||||
/list - show all irc<->evennia mappings
|
/list - show all irc<->evennia mappings
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
@ -807,10 +808,11 @@ class CmdIRC2Chan(MuxCommand):
|
||||||
if('disconnect' in self.switches or 'remove' in self.switches or
|
if('disconnect' in self.switches or 'remove' in self.switches or
|
||||||
'delete' in self.switches):
|
'delete' in self.switches):
|
||||||
botname = "ircbot-%s" % self.lhs
|
botname = "ircbot-%s" % self.lhs
|
||||||
matches = PlayerDB.objects.filter(db_is_bot=True, db_key=botname)
|
matches = PlayerDB.objects.filter(db_is_bot=True, username=botname)
|
||||||
if not matches:
|
dbref = utils.dbref(self.lhs)
|
||||||
|
if not matches and dbref:
|
||||||
# try dbref match
|
# try dbref match
|
||||||
matches = PlayerDB.objects.filter(db_is_bot=True, id=self.args.lstrip("#"))
|
matches = PlayerDB.objects.filter(db_is_bot=True, id=dbref)
|
||||||
if matches:
|
if matches:
|
||||||
matches[0].delete()
|
matches[0].delete()
|
||||||
self.msg("IRC connection destroyed.")
|
self.msg("IRC connection destroyed.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue