Giter VIP home page Giter VIP logo

wechaty's Introduction

python-wechaty-getting-started PyPI Version Python 3.7

Python Wechaty

Gitpod Ready-to-Code Wechaty in Python

Python Wechaty Starter Project Template that Works Out-of-the-Box

Connecting Chatbots

Powered by Wechaty

Wechaty is a RPA SDK for Wechat Individual Account that can help you create a chatbot in 9 lines of Python.

Requirements

  1. python3.7+

Quick Start

  1. Clone python-wechaty-getting-started repository

    git clone https://github.com/wechaty/python-wechaty-getting-started
    cd python-wechaty-getting-started
  2. Install Dependencies

    make install
    # or
    pip install -r requirements.txt
  3. Set token for your bot

    # examples/ding-dong-bot.py : func-> main()
    # it must be donut token
    export WECHATY_PUPPET=wechaty-puppet-hostie
    export WECHATY_PUPPET_HOSTIE_TOKEN=your_token_at_here
  4. Run the bot

    make bot
    # or
    python examples/ding-dong-bot.py

The World's Shortest Python ChatBot: 9 lines of Code

from wechaty import Wechaty

import asyncio
async def main():
    bot = Wechaty()
    bot.on('scan', lambda status, qrcode, data: print('Scan QR Code to login: {}\nhttps://wechaty.github.io/qrcode/{}'.format(status, qrcode)))
    bot.on('login', lambda user: print('User {} logined'.format(user)))
    bot.on('message', lambda message: print('Message: {}'.format(message)))
    await bot.start()
asyncio.run(main())

Wechaty Getting Started in Multiple Languages

Badge

Wechaty in Python

[![Wechaty in Python](https://img.shields.io/badge/Wechaty-Python-blue)](https://github.com/wechaty/python-wechaty)

Maintainers

@wechaty/python

Copyright & License

  • Code & Docs © 2020 Wechaty Contributors https://github.com/wechaty
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

wechaty's People

Contributors

kukuku119 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.