Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

groupme-push-0.0.3.tar.gz (16.4 kB view hashes)

Uploaded Source

Built Distribution

groupme_push-0.0.3-py3-none-any.whl (16.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page