Giter VIP home page Giter VIP logo

archbot's People

Contributors

mawwalker avatar

Stargazers

 avatar  avatar  avatar

Forkers

msechen

archbot's Issues

为什么我用flask接受不到telegram-bot的消息?大佬用空解答下吗?谢谢!

代码如下:startbot()中接受不到信息进行处理,但是setwebhook之后能够自动接收到telegram-bot的信息

# 初始化 mxbot
tg_bot = mxbot.mxbot(Logger)

# """
@app.route("/"+access_token, methods=["POST", "GET"])
def startbot():
    Logger.info("go into start bot")
    # if (request.method == "POST") or (request.method == "GET"):
    try:
        tg_bot.bot_main()
    except Exception as e:
        Logger.error("start bot ",e)
# """

def setwebhook():
    updater = Updater(token=access_token, use_context=True)
    updater.start_webhook(listen='0.0.0.0',
                          port=8443,
                          url_path=access_token,
                          key=private_key_path,
                          cert=cert_pem_path,
                          webhook_url='https://*.*.*.*:8443/'+access_token)
                        # webhook_url = 'https://example.com:8443/TOKEN')

if __name__ == '__main__':
    # 初始化updater
    # _ = updater_bot.MixUpdater(Logger,mxbot_settings_file)
    setwebhook()
    app.run(host='0.0.0.0', port=8443, debug=True)

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.