errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.12k stars 614 forks source link

Abstract method email in errbot/errbot/backends/base.py problem with gitter plugin #1460

Closed fernand0 closed 3 years ago

fernand0 commented 3 years ago

In order to let us help you better, please fill out the following fields as best you can:

I am...

I am running...

Issue description

I've upgrade my errbot version to the last one. I'm using gitter plugin. When starting the bot does not work and launches this message: "TypeError: Can't instantiate abstract class GitterPerson with abstract methods email"

The problem seems to be that gitter.py does not have an email method. It can be solved adding, for example:

@property 
def email(self): 
     return ""

To the code, but I'm not sure if this is the best way to solve the problem and, maybe, this method should not be and abstract property.

nzlosh commented 3 years ago

I tend to agree that base Person should not be an abstractmethod. Since the change was introduced specifically for Slack purposes, the base class should implement a sane default that other backends can override if it makes sense to do so.

Gitter is being mentioned here but any errbot backends external to the core errbot repository will most likely be impacted, Discord, Mattermost and RocketChat come to mind.

@sijis What are your thoughts?

sijis commented 3 years ago

@nzlosh @fernand0 Not ideal that broken existing backends. I put in a PR to address it. Would you be able to verify it fixes the problem?

fernand0 commented 3 years ago

I've installed your branch and I think it solves the problem. Thanks.