Shut down existing IRC/RSS bots if starting with IRC/RSS_ENABLED=False. Resolves #1238.
This commit is contained in:
parent
effa618268
commit
b04a50fe28
1 changed files with 14 additions and 0 deletions
|
|
@ -13,6 +13,9 @@ from evennia.utils import utils
|
||||||
|
|
||||||
_IDLE_TIMEOUT = settings.IDLE_TIMEOUT
|
_IDLE_TIMEOUT = settings.IDLE_TIMEOUT
|
||||||
|
|
||||||
|
_IRC_ENABLED = settings.IRC_ENABLED
|
||||||
|
_RSS_ENABLED = settings.RSS_ENABLED
|
||||||
|
|
||||||
_SESSIONS = None
|
_SESSIONS = None
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -157,6 +160,12 @@ class IRCBot(Bot):
|
||||||
irc_ssl (bool): Indicates whether to use SSL connection.
|
irc_ssl (bool): Indicates whether to use SSL connection.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if not _IRC_ENABLED:
|
||||||
|
# the bot was created, then IRC was turned off. We delete
|
||||||
|
# ourselves (this will also kill the start script)
|
||||||
|
self.delete()
|
||||||
|
return
|
||||||
|
|
||||||
global _SESSIONS
|
global _SESSIONS
|
||||||
if not _SESSIONS:
|
if not _SESSIONS:
|
||||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||||
|
|
@ -360,6 +369,11 @@ class RSSBot(Bot):
|
||||||
RuntimeError: If `ev_channel` does not exist.
|
RuntimeError: If `ev_channel` does not exist.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if not _RSS_EMABLED:
|
||||||
|
# The bot was created, then RSS was turned off. Delete ourselves.
|
||||||
|
self.delete()
|
||||||
|
return
|
||||||
|
|
||||||
global _SESSIONS
|
global _SESSIONS
|
||||||
if not _SESSIONS:
|
if not _SESSIONS:
|
||||||
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
from evennia.server.sessionhandler import SESSIONS as _SESSIONS
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue