This repository has been archived on 2025-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
fbchat/docs/examples.rst
Mads Marquart d2741ca419 Added baseline for sphinx documentation and on2FACode event
The docs are still very WIP, but they should be functional. Just
execute `make html` in the docs folder, and you should be able to
navigate to `/docs/_build/html` and view it in your browser
2017-05-26 13:38:54 +02:00

53 lines
1.0 KiB
ReStructuredText

.. highlight:: python
.. _examples:
Examples
========
These are a few examples on how to use `fbchat`. Remember to swap out `<email>` and `<password>` for your email and password
Sending messages
----------------
This will send one of each message type to the specified thread
.. literalinclude:: ../examples/send.py
:language: python
Getting information
-------------------
This will show the different ways of fetching information about users and threads
.. literalinclude:: ../examples/get.py
:language: python
Echobot
-------
This will reply to any message with the same message
.. literalinclude:: ../examples/echobot.py
:language: python
Remove bot
----------
This will remove a user from a group if they write the message `Remove me!`
.. literalinclude:: ../examples/removebot.py
:language: python
"Keep it"-bot
-------------
This will prevent chat color, emoji, nicknames and chat name from being changed. It will also prevent people from being added and removed
.. literalinclude:: ../examples/keepbot.py
:language: python