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

!help throws AttributeError: 'MatrixModule' object has no attribute 'info' #175

Open
matthijskooijman opened this issue Oct 6, 2021 · 4 comments

Comments

@matthijskooijman
Copy link

I just cloned the latest git master (cc65d63) and ran it in docker, which seems to work. However, the !help command seems to be broken. The log says:

hemppa-matrix-bot | 2021-10-07 01:21:43,792 - ERROR - hemppa - unhandled exception in !help                                                                   
hemppa-matrix-bot | Traceback (most recent call last):
hemppa-matrix-bot |   File "/bot/bot.py", line 444, in message_cb
hemppa-matrix-bot |     await moduleobject.matrix_message(self, room, event)
hemppa-matrix-bot |   File "/bot/modules/help.py", line 69, in matrix_message
hemppa-matrix-bot |     msg = msg + '\n' + self.info
hemppa-matrix-bot | AttributeError: 'MatrixModule' object has no attribute 'info'  
@vorletzter
Copy link

vorletzter commented Oct 11, 2021

Ran into the same Issue.

As far as i can tell, the Bot needs to save some settings to
{self.client.homeserver}/_matrix/client/r0/user/{userid}/account_data/{self.appid}?access_token={self.client.access_token}
in order for the get_settings() method to succeed. Otherwise self.info is not getting set.

Issue should resolve itself, after a restart of the Bot.

Otherwise a quick solution might be to add
self.info = "More information at https://github.com/vranki/hemppa"
to init in modules/help.py

@ellidi
Copy link

ellidi commented May 11, 2022

Issue should resolve itself, after a restart of the Bot.

I have this issue as well, bot restart doesn't help. Any ideas?

@vorletzter
Copy link

vorletzter commented May 12, 2022

I think you need to safe some settings in order for the method to succeed.
Or you could try wrapping the method in try / except: AttributeError or assigning info a default value.

I haven't really looked into the issue though.

@zikapanam
Copy link

zikapanam commented May 3, 2023

Hello,

I'm totally new to hemppa. I ran into the same issue.

Can someone tell me how to write settings ?

The command "!bot export" give me an error.

| Traceback (most recent call last): hemppa | File "./bot.py", line 444, in message_cb hemppa | await moduleobject.matrix_message(self, room, event) hemppa | File "/bot/modules/bot.py", line 57, in matrix_message hemppa | await self.export_settings(bot, event) hemppa | File "/bot/modules/bot.py", line 221, in export_settings hemppa | data = bot.get_account_data()['module_settings'] hemppa | TypeError: 'NoneType' object is not subscriptable
Thx for your help !

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

No branches or pull requests

4 participants