Update plugin.py

This commit is contained in:
Gordon Shumway 2019-02-19 03:17:59 -05:00 committed by GitHub
parent 7f12febf6e
commit 84cdfc8496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 5 deletions

View File

@ -40,11 +40,21 @@ class MUD(callbacks.Plugin):
"""
channel = msg.args[0]
nick = msg.nick
self.tn[nick] = Telnet(self.registryValue('server'), self.registryValue('port'))
response = self.output(self.tn[nick])
for line in response:
if line.strip():
irc.reply(line, prefixNick=False)
def join(self, irc, msg, args):
"""
Join the MUD
"""
channel = msg.args[0]
nick = msg.nick
try:
if self.tn[nick]:
irc.reply("You already have an open connection. Please stop that connection first.")
except:
self.tn[nick] = Telnet(self.registryValue('server'), self.registryValue('port'))
response = self.output(self.tn[nick])
for line in response:
if line.strip():
irc.reply(line, prefixNick=False)
join = wrap(join)
def m(self, irc, msg, args, input):