GithubHelp home page GithubHelp logo

maubot-chatgpt's People

Contributors

bhasherbel avatar mxmarx avatar williamkray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

maubot-chatgpt's Issues

any user without explicit display nick causes bot to crash

Hello,
plugin starts ok in maubot docker 0.4.2
Config also seems ok (i just updated your chatgpt package from 0.0.4 to 0.0.7 and used the updated config template).
I also re-registered the bot within maubot.
When I open a chat, the bot joins automatically but I get no response. In maubot i see this error every time I write a message - how can I solve that? Is it a config error? Thank you!

Failed to run handler
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/mautrix/client/syncer.py", line 236, in _catch_errors
    await handler(data)
  File "/data/plugins/org.jobmachine.chatgpt-v0.0.7.mbp/gpt.py", line 84, in on_message
    if not await self.should_respond(event):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/plugins/org.jobmachine.chatgpt-v0.0.7.mbp/gpt.py", line 60, in should_respond
    if re.search("(^|\s)(@)?" + self.name + "([ :,.!?]|$)", event.content.body, re.IGNORECASE):
                 ~~~~~~~~~~~~~^~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

Allow regex in allowed_users

Allow regex like '^@.*homeserverdomain\.tld$' in paramter allowed_users, so that everyone of a homeserver can use chatgpt.

Allow list syntax

Hello!
Thank you for this maubot - it works great!
How is the allow_users list supposed to be used?
When I add users with the real username @username:matrix.org i get a syntax error in the config file and the bot crashes:
ruamel.yaml.scanner.ScannerError: while scanning for the next token

found character '@' that cannot start any token
in "", line 8, column 16:
allowed_users: @user:matrix.org
^ (line: 8)

When adding users to the list as [user1:matrix.org user2:matrix.org user3:matrix.org] it's also not working - not allowed.

Any help is appreciated - thanks!

deleting messages causes problems in encrypted rooms

in an encrypted room with threaded-responses disabled, if i delete any message in the recent history the bot has trouble capturing the messages to use for context.

the following is an example from the logs of my testing instance:

[06:24:01](file:////opt/maubot/maubot/matrix.py:287)WARNING[client/@clorg:jobmachine.org](https://maubot.dev.jobmachine.org/#/client/@clorg:jobmachine.org)/cryptoget_event: Failed to decrypt $P5iiCx8v3WAsdfeD8tyGrIO-PQPUo3BjKY5yHV5tyv0: Unsupported event content class
[06:24:01](file:////data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py:107)ERROR[instance/gpt](https://maubot.dev.jobmachine.org/#/instance/gpt)Something went wrong: Decryption error!
[06:24:01](file:////data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py:107)ERROR[instance/gpt](https://maubot.dev.jobmachine.org/#/instance/gpt)Traceback (most recent call last):
  File "/data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py", line 91, in on_message
    context = await self.get_context(event)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py", line 176, in get_context
    async for next_event in self.generate_context_messages(event):
  File "/data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py", line 216, in generate_context_messages
    raise ValueError("Decryption error!")
ValueError: Decryption error!

workarounds include sending a message with enough words in it to push the deletion event far enough back to not be included in the context, or enable threads in the bot temporarily until this naturally happens.

in the meantime, it is strongly advised to avoid deleting messages in encrypted rooms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.