GroupMe push service wrapper
Project description
Groupme Push Client
This is a simple client for the GroupMe push service (Faye).
Installation
run pip install groupme-push
, or clone the repo and run pip install .
Usage
import from groupme_push.client import PushClient
PushClient has a couple of paramaters:
- access_token - GroupMe access token for the user that you want to listen for
- on_message - a function to call whenver there is a new message in any group the user is in
- on_dm - callback for DMs
- on_like - callback for when another user likes a message
- on_favorite - callback for when your user likes a message
- on_other - for any other type of message, such as poll results
- disregard_self - if the listener should disregard messages originating from the user
create a PushClient object with
client = PushClient(access_token=groupme_access_token)
to start listening, use client.start()
, and to stop use client.stop()
to start listening to a group, use client.subscribe_to_group(groupid)
. Note that this should allow you to see when users are typing, but currently appears to provide no extra information.
Example
from groupme_push.client import PushClient
import time
import logging
def on_message(message):
print(message["text"])
groupme_access_token = "useraccesstoken"
logging.basicConfig(level=logging.DEBUG)
client = PushClient(access_token=groupme_access_token, on_message=on_message)
client.start()
Issues
If you encounter any bugs or have feature requests, please open an issue on GitHub
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file groupme-push-0.0.3.tar.gz
.
File metadata
- Download URL: groupme-push-0.0.3.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b72c0ea52e346142b6edd07bfc464467483f60e5069ff2790ea2473ef756d61 |
|
MD5 | 3483bd54208530ad3e9108f1016d72e8 |
|
BLAKE2b-256 | 94de7360e0084abc6db16099e6eaa418517234e421821534ab412cf921158e9b |
File details
Details for the file groupme_push-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: groupme_push-0.0.3-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | def04d3d34661e23cf15a8b68f5564f7d8291eedb75ad4dfe57fcbb3b0289ff0 |
|
MD5 | 2bfa695dddde809d8edc12678c28a922 |
|
BLAKE2b-256 | 35091fceff6b108dd2a562e60e3b190ba1cbf240be451084a593c0d04e9873b0 |