Added GraphQL requests

This commit is contained in:
Mads Marquart
2017-06-22 22:38:15 +02:00
parent c81d7d2bfb
commit 11e59e023c
12 changed files with 564 additions and 202 deletions

View File

@@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

View File

@@ -2,8 +2,8 @@
.. module:: fbchat
.. _faq:
Frequently asked questions
==========================
FAQ
===
Version X broke my installation
-------------------------------

View File

@@ -55,7 +55,7 @@ This is required for many of `fbchat`'s functions, since Facebook differetiates
Searching for group chats and finding their ID is not yet possible with `fbchat`,
but searching for users is possible via. :func:`Client.searchForUsers`. See :ref:`intro_fetching`
You can get your own user ID by using :any:`Client.id`
You can get your own user ID by using :any:`Client.uid`
Getting the ID of a group chat is fairly trivial though, since you only need to navigate to `<https://www.facebook.com/messages/>`_,
click on the group you want to find the ID of, and then read the id from the address bar.
@@ -108,7 +108,7 @@ like adding users to and removing users from a group chat, logically only works
The simplest way of using `fbchat` is to send a message.
The following snippet will, as you've probably already figured out, send the message `test message` to your account::
message_id = client.sendMessage('test message', thread_id=client.id, thread_type=ThreadType.USER)
message_id = client.sendMessage('test message', thread_id=client.uid, thread_type=ThreadType.USER)
You can see a full example showing all the possible thread interactions with `fbchat` by going to :ref:`examples`
@@ -125,7 +125,7 @@ The following snippet will search for users by their name, take the first (and m
users = client.searchForUsers('<name of user>')
user = users[0]
print("User's ID: {}".format(user.id))
print("User's ID: {}".format(user.uid))
print("User's name: {}".format(user.name))
print("User's profile picture url: {}".format(user.photo))
print("User's main url: {}".format(user.url))

View File

@@ -5,7 +5,7 @@ pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python3.6 -msphinx
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set BUILDDIR=_build

View File

@@ -11,13 +11,11 @@ This page will be periodically updated to show missing features and documentatio
Missing Functionality
---------------------
- Implement Client.searchForThread
- This will use the graphql request API
- Implement Client.searchForMessage
- This will use the graphql request API
- Implement chatting with pages
- This might require a new :class:`models.ThreadType`, something like ``ThreadType.PAGE``
- Rework `Message` model, to make the whole process more streamlined
- Implement chatting with pages properly
- Write better FAQ
- Explain usage of graphql
Documentation