mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-05-06 11:33:42 -05:00
TextAdventures: try/except message handling
This commit is contained in:
parent
665ba1497f
commit
e2c8e89440
@ -99,12 +99,17 @@ class TextAdventures(callbacks.Plugin):
|
|||||||
if not self.registryValue('requireCommand') or not irc.isChannel(msg.args[0]):
|
if not self.registryValue('requireCommand') or not irc.isChannel(msg.args[0]):
|
||||||
self.game.setdefault(channel, None)
|
self.game.setdefault(channel, None)
|
||||||
if self.game[channel]:
|
if self.game[channel]:
|
||||||
|
try:
|
||||||
command = msg.args[1]
|
command = msg.args[1]
|
||||||
self.game[channel].sendline(r'{}'.format(command))
|
self.game[channel].sendline(r'{}'.format(command))
|
||||||
response = self.output(self.game[channel])
|
response = self.output(self.game[channel])
|
||||||
for line in response[1:]:
|
for line in response[1:]:
|
||||||
if line.strip() and line.strip() != ".":
|
if line.strip() and line.strip() != ".":
|
||||||
irc.reply(line, prefixNick=False)
|
irc.reply(line, prefixNick=False)
|
||||||
|
except:
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user