Skip to content

Commit

Permalink
allow multiline settings (system promts seems to work better with new…
Browse files Browse the repository at this point in the history
…lines sometimes)
  • Loading branch information
Christian Ulrich committed Apr 23, 2024
1 parent 8aa6d4e commit 3c87f9a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,20 @@ async def tell(room, message):
await bot.api.send_text_message(room.room_id, 'ok')
elif match.command("change-setting") or match2.command("change-setting"):
set_target = None
if match2.command("change-setting"):
match = match2
for server in servers:
if server.room == room.room_id:
set_target = server
if set_target:
server = set_target
setattr(server,match.args()[1],' '.join(match.args()[2:]))
tattr = message.body
tattr = tattr[tattr.find(match.args()[1])+len(match.args()[1])+1:]
setattr(server,match.args()[1],tattr)
set_target = server
await save_servers()
await bot.api.send_text_message(room.room_id, 'ok')
if match != match2:
await bot.api.send_text_message(room.room_id, 'ok')
elif (match.is_not_from_this_bot() and match.prefix())\
and match.command("restart"):
pf = None
Expand Down

0 comments on commit 3c87f9a

Please sign in to comment.