Browse Source

set matrix device_name

master
Hendrik Langer 2 years ago
parent
commit
8ba1a2fe56
  1. 9
      matrix_pygmalion_bot/core.py

9
matrix_pygmalion_bot/core.py

@ -189,10 +189,11 @@ class Callbacks(object):
class ChatBot(object): class ChatBot(object):
"""Main chatbot""" """Main chatbot"""
def __init__(self, homeserver, user_id, password): def __init__(self, homeserver, user_id, password, device_name="matrix-nio"):
self.homeserver = homeserver self.homeserver = homeserver
self.user_id = user_id self.user_id = user_id
self.password = password self.password = password
self.device_name = device_name
self.runpod_api_key = None self.runpod_api_key = None
@ -352,7 +353,11 @@ async def main() -> None:
homeserver = config[section]['url'] homeserver = config[section]['url']
user_id = config[section]['username'] user_id = config[section]['username']
password = config[section]['password'] password = config[section]['password']
bot = ChatBot(homeserver, user_id, password) if config.has_option(section, 'device_name'):
device_name = config[section]['device_name']
else:
device_name = "matrix-nio"
bot = ChatBot(homeserver, user_id, password, device_name)
bot.character_init(botname, config[section]['persona'], config[section]['scenario'], config[section]['greeting']) bot.character_init(botname, config[section]['persona'], config[section]['scenario'], config[section]['greeting'])
if config.has_option(section, 'owner'): if config.has_option(section, 'owner'):
bot.owner = config[section]['owner'] bot.owner = config[section]['owner']

Loading…
Cancel
Save