Commit 42b0ce51 authored by Kirk Bater's avatar Kirk Bater Committed by Sijis Aviles

Added optional room arg to inroom

parent 27564bdc
......@@ -383,7 +383,7 @@ class TextBackend(ErrBot):
raise ValueError('A Room name must start by #.')
text_room = TextRoom(room[1:], self)
if text_room not in self._rooms:
self._rooms.append(text_room)
self._rooms.insert(0, text_room)
return text_room
@property
......
from errbot import BotPlugin, botcmd
from errbot import BotPlugin, botcmd, arg_botcmd
INROOM, USER, MULTILINE = 'inroom', 'user', 'multiline'
......@@ -43,12 +43,17 @@ class TextModeCmds(BotPlugin):
super().deactivate()
@botcmd
def inroom(self, msg, _):
def inroom(self, msg, args):
"""
This puts you in a room with the bot.
"""
self._bot._inroom = True
return f'Joined Room {self._bot._rooms[0]}.'
if args:
room = args
if not room:
room = '#testroom'
self._bot.query_room(room).join()
return f'Joined Room {room}.'
@botcmd
def inperson(self, msg, _):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment