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

add watch_topic #31

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
19 changes: 16 additions & 3 deletions pydiscourse/client.py
Expand Up @@ -551,6 +551,19 @@ def delete_topic(self, topic_id, **kwargs):
"""
return self._delete(u"/t/{0}".format(topic_id), **kwargs)

def watch_topic(self, topic_id, username, **kwargs):
"""

Args:
topic_id:
**kwargs:

Returns:

"""
self.api_username = username
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this resetting the api_username? That's the username to connect to the API with, and it's already set when creating the client instance. Changing it here would presumably result in authentication errors trying to make requests to the Discourse API...

return self._post("/t/{0}/notifications.json".format(topic_id), **kwargs)

def post(self, topic_id, post_id, **kwargs):
"""

Expand Down Expand Up @@ -941,11 +954,12 @@ def groups(self, **kwargs):
"""
return self._get("/groups/search.json", **kwargs)

def group(self, group_name):
def group(self, group_name, **kwargs):
print("this ist my gydiscourse version")
"""
Get all infos of a group by group name
"""
return self._get("/groups/{0}/members.json".format(group_name))
return self._get("/groups/{0}/members.json".format(group_name), **kwargs)

def create_group(
self,
Expand Down Expand Up @@ -1351,7 +1365,6 @@ def _request(self, verb, path, params={}, files={}, data={}, json={}):

"""
url = self.host + path

headers = {
"Accept": "application/json; charset=utf-8",
"Api-Key": self.api_key,
Expand Down