Giter VIP home page Giter VIP logo

genshin-impact-stats-telegram-bot's Introduction

Description

Telegram Bot to track real-time stats of Genshin Impact.

Requirements

  • python
  • sqlite3

BotFather set up

Create a bot with @BotFather and set the following commands:

help - List of commands.
menu - Interact with me using UI.
redeem - Redeem the gift code.
set - Set resin/teapot/updates values.
get - Get resin/teapot/updates values.

Run

  • Install python dependencies.

    pip install -r requirements.txt

    If you want to contribute, install also development dependencies.

    pip install -r dev_requirements.txt

  • Create a self-signed certificate in order to communicate with telegram server using SSL.

    openssl req -newkey rsa:2048 -sha256 -nodes -keyout paimon.key -x509 -days 3650 -out paimon.pem

  • Create a copy of config.template.json and change the dummy values in .config.json.

    cp config.template.json .config.json

    • token - Telegram bot token, obtained from @BotFather

    • webhook: true to run the bot using webhooks. false to use polling.

    • ip: Your server ip, where the bot is hosted

    • port: Port to receive telegram updates: port must be 443, 80, 88 or 8443.

    • cert: Path to your server certificate (can be self-signed)

    • timezone: Your timezone as TZ database name

    • telegram_uid - Must be changed with your actual telegram uid. You can obtain your telegram uid from bots like @getmyid_bot.

        "accounts": {
            "123123123": {
                "ltoken": "..."
            }
        }

    The following cookies can be obtained using the tutorial from genshin.py

  • Execute the bot.

    ./paimon.py

    Note: If you run the bot in port 80, it may be needed to run the bot as superuser (sudo).

Contributing

Happy to see you willing to make the project better. In order to make a contribution, please respect the following format:

  • Imports sorted with usort: usort format <file>
  • Code formatted with black (line lenght 79): black -l 79 <file>

If you are using flake8, ignore E203 in .flake8

[flake8]
extend-ignore = E203

VSCode project settings

VSCode should have the following settings in settings.json:

{
    "python.analysis.fixAll": [],
    "python.formatting.blackArgs": [
        "-l 79"
    ],
    "python.formatting.provider": "black",
    "isort.path": [
        "usort format"
    ],
}
"python.linting.flake8Args": [
    "--ignore=E203",
],

If you are using flake8, ignore E203 warning.

License

Copyright (c) 2021-2024 scmanjarrez. All rights reserved.
This work is licensed under the terms of the MIT license.

For a copy, see LICENSE.

genshin-impact-stats-telegram-bot's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar scmanjarrez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

shipper100

genshin-impact-stats-telegram-bot's Issues

Features request

hi. could you add teapot currency, parametric transformer and expeditions notification, please?
also, i think it would be great to make resin notification configurable (manually set resin to notify using setting or at least value in config, not 150+ only). for example, you can send "/notify 40" and bot will send you message when your resin is 40, if you used resin and don't set "/notify", it notifies when resin reaches value that is provided in config/settings.
and add option to set info updating time, please!
thanks a lot

Bot only works for collecting daily rewards

hi. i can't use bot since it doesn't reply to any of my messages in telegram, but it collects daily rewards as it should. what should i do? ask for info, i'll provide it
image
image

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.