在python中轻松使用groupme api
pygroupme的Python项目详细描述
PyGroupMe 0.0.3版
groupme api的简单python包装器,允许用户通过请求模块与微软的groupme消息平台交互。我意识到在Python中没有API的现有包装,并在代码中反复键入与GROMPE接口所需的代码是令人费解的。为了与groupme交互,用户首先需要有groupme帐户和指定的groupme组,然后在https://dev.groupme.com/session/new注册一个bot,并向程序提供其bot id以发送消息和/或接收消息的令牌代码。
示例用法:
import pygroupme as pgm
pgm.gm_msg(bid=BOT_ID_HERE, text="Hello, world!") # sends "Hello, world!" to the GroupMe chat in which the user has set up his GroupME api interface
message = pgm.gm_rec(token=USER_TOKEN_HERE, gid=USER_GID_HERE, limt=n) # receive the last n messages from a GroupMe chat, default is 1