Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base.py:66 - url = self.server_url + api_path + method gives unsupported operand types error #281

Open
qmastery16 opened this issue Jan 22, 2025 · 1 comment

Comments

@qmastery16
Copy link

qmastery16 commented Jan 22, 2025

Good day, @jadolg ! I'm trying to use your repository with various example bots that depend on it, like

as a starting point for my further development. However, even with the most basic samples I always encounter this error:

Traceback (most recent call last):
  File "./sample.py", line 28, in <module>
    bot.run(chat_type='d', sleep=0.5)
  File ".../site-packages/pyrocketbot/client.py", line 42, in run
    updates = self.get_updates()
  File ".../site-packages/pyrocketbot/client.py", line 35, in get_updates
    response = self.session.subscriptions_get().json()
  File ".../site-packages/rocketchat_API/APISections/subscriptions.py", line 7, in subscriptions_get
    return self.call_api_get("subscriptions.get", kwargs=kwargs)
  File ".../site-packages/rocketchat_API/APISections/base.py", line 66, in call_api_get
    url = self.server_url + api_path + method
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Although these third-party example bots have been developed while your rocketchat_API repository was older, downgrading with pip install rocketchat_API==1.28.1 didn't fix this issue; tried Python 3.10.16 / 3.12.8 versions. A temporary solution may be to simply to hardcode the value of self.server_url variable into this string, however it's not elegant... Hope this info could be helpful, have a nice day

P.S. While a most basic example described in Usage works fine, it doesn't involve receiving/processing/responding to the messages...

@jadolg
Copy link
Owner

jadolg commented Jan 22, 2025

I do not fully understand the issue.
The linked pull request seem to be a bit of everything.
The issue in ntk148v/rocketbot seems also unrelated.

The error you are referencing here is caused probably by setting the server_url variable to None which is not supported since it's needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants