コード例 #1
0
ファイル: server.py プロジェクト: wmc54321/wrist
def subEvent(msg):
    try:
        User.objects.get(openid=msg.source)
    except:
        User.objects.create(openid=msg.source, likenum=0, coins=0, sign="真懒,啥也没留下")
        tools.updateInfo(msg.source)
        menu = (
            '{"button":[{"type":"click","name":"好友排行","key":"V1000_FRIEND"},'
            + '{"type":"click","name":"产品简介","key":"V1000_HELP"},'
            + '{"name":"健康数据","sub_button":[{"type":"click","name":"运动步数","key":"V1000_STEP"},{"type":"click","name":"睡眠状况","key":"V1000_SLEEP"}]}]}'
        )
        tools.menuCreate(menu)
    tools.customSendArticle(
        msg.source,
        u"或许这些能对您有帮助",
        u"",
        "https://raw.githubusercontent.com/wmc54321/wrist/hj/%E4%BA%8C%E5%90%88%E4%B8%80/wrist/static/images/help.png",
        "http://" + tools.IP + "/handbook/",
    )
    return HttpResponse(create_reply(u"感谢您的关注", message=msg))
コード例 #2
0
ファイル: menu.py プロジェクト: zjcAlistar/myadmilk
def menuInit():
    return tools.menuCreate(menu)