Skip to content

Conversation

@attzonko
Copy link
Contributor

@attzonko attzonko commented Jan 6, 2018

This is our working version of the BOT which integrates a few of the outstanding pull requests as well as adds support for APIv4. Many of the changes including the APIv4 support were previously contributed by @seLain back in Sep'17, I just grabbed them from his repository and got them to work together with a few minor tweaks. Below is a high level summary of the changes.

@jasonblais
Copy link

@gotlium let us know if you have time to review this PR. Thanks! :)

attzonko and others added 8 commits January 5, 2018 20:03
Adding APIv4 Support and a few other features
ignore messages with ignore strings anywhere in message, not just the…
Getting the Multiple plugins Fix
Pulling in the multiple plugin fix
Minor fixes for APIv4 usage with multiple teams
@jasonblais
Copy link

@gotlium @deniskabalkin Would you have thoughts on the best way to transfer ownership of https://pypi.python.org/pypi/mattermost_bot?

@attzonko is open to assuming ownership of the repo and/or forking it for now.

@epatpol
Copy link

epatpol commented Jan 25, 2018

I was actually looking into making the bot work with apiv4, but it seems there's already a PR opened for it (awesome!). So for that I hope @gotlium gives a pong back soon :)

@Sebastien-Meiffren
Copy link

Hi,
I've been trying to use your new version of the bot, but I keep having a team issue

Traceback (most recent call last):
  File "C:/Users/chuiv/PycharmProjects/bot_mattermost/run.py", line 5, in <module>
    Bot().run()
  File "C:\Users\chuiv\PycharmProjects\bot_mattermost\mattermost_bot\bot.py", line 29, in __init__
    settings.SSL_VERIFY)
  File "C:\Users\chuiv\PycharmProjects\bot_mattermost\mattermost_bot\mattermost_v4.py", line 110, in __init__
    self.login(team, email, password)
  File "C:\Users\chuiv\PycharmProjects\bot_mattermost\mattermost_bot\mattermost.py", line 184, in login
    self.user = self.api.login(team, email, password)
  File "C:\Users\chuiv\PycharmProjects\bot_mattermost\mattermost_bot\mattermost_v4.py", line 25, in login
    self.load_initial_data()
  File "C:\Users\chuiv\PycharmProjects\bot_mattermost\mattermost_bot\mattermost_v4.py", line 34, in load_initial_data
    self.default_team_id = self.teams[0]['id']
IndexError: list index out of range

If I print self.teams = self.get('/teams'), I get an empty array []

If I connect to the webclient like a normal person / user, everything works fine

@attzonko
Copy link
Contributor Author

attzonko commented Feb 5, 2018

@Sebastien-Meiffren I went ahead and opened an issue for you in my fork, for now it would be easier to resolve this there and push the change/fix to this pull request. Here is the link to the issue.

@epatpol
Copy link

epatpol commented Feb 26, 2018

Sorry to hijack this PR but as a python beginner what's the best way to use your fork meanwhile? I used pip to get the latest version from LPgenerator but I would like to test out these changes at the moment.

@seLain
Copy link

seLain commented Feb 27, 2018

I would do it this way without removing installed mattermost_bot (from PyPI) :

  1. create a virtual environment mmpy_bot_test
    python -m venv mmpy_bot_test
  2. activate the virtual environment
    mmpy_bot_test\Scripts\activate
  3. install attzonko's fork:master
    pip install git+https://github.com/attzonko/mattermost_bot.git
  4. then you can test your bot under this virtual environment

@timball
Copy link

timball commented Feb 27, 2018

MM api docs claim that the v3 api is deprecated as of 2018-01-16.

How far away is this code from being able to be merged?

--timball

@attzonko
Copy link
Contributor Author

@timball Not sure the original author is ever planning to merge this in. Feel free to use my fork of this project. I plan on making a new pypi package shortly.

@timball
Copy link

timball commented Feb 27, 2018 via email

@epatpol
Copy link

epatpol commented Mar 1, 2018

Before you could get around without using MATTERMOST_BOT_SETTINGS_MODULE but now you have to? I see that you changed it from os.get to os.environ, any reasons for that?

@epatpol
Copy link

epatpol commented Mar 1, 2018

NVM I see that you updated the readme on how to use it thank you :)

@timball
Copy link

timball commented Mar 2, 2018 via email

seLain added 4 commits March 2, 2018 08:42
- revise test cases
- merge mattermost_v4 to mattermost, remove all APIv3 endpoints
- the existing webhook-related part was revised to APIv4 endpoints, but not fully tested yet.
@scottleedavis
Copy link

scottleedavis commented Jun 22, 2018

@attzonko I am interested in contributing! I have a vested interest in seeing this apiV4 support thru and love python too! :)

@attzonko
Copy link
Contributor Author

@scottleedavis Hey we ended up creating a new repo from this instead of a fork to change the name and be able to release pypi packages. take a look at https://github.com/attzonko/mmpy_bot

Would love to have you contribute!

@attzonko attzonko closed this Jul 27, 2018
@attzonko attzonko deleted the working_apiv4 branch July 27, 2018 05:24
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

Successfully merging this pull request may close these issues.

8 participants