yihong dba36ffae8
Merge pull request #13 from jinwyp/dev
feat: Separate the configuration files into env
2023-12-17 08:00:40 +08:00
2023-12-15 12:57:32 +08:00
2023-12-16 18:23:22 +08:00
2023-12-14 19:59:18 +08:00
2023-12-11 19:18:55 +08:00
2023-12-14 22:33:00 +08:00

tg_bot_collections

Collections of yihong0618's telegram bot

for yihong0618's channel: https://t.me/hyi0618

Bot -> poster

image

Bot -> pretty mapper

image

Bot -> Gemini player

  1. visit https://makersuite.google.com/app/apikey get the key
  2. export GOOGLE_GEMINI_KEY=${the_key}
  3. use gemini: ${message} to ask

telegram-cloud-photo-size-5-6336976091083817765-y

HOW TO Install and Run

Run with systemd service

  1. Git clone this repo

  2. cd tg_bot_collections

  3. Copy file .env.example to .env

  4. Edit .env file and change the following variables

    • Google_Gemini_API_Key (Google Gemini API KEY)
    • Telegram_Bot_Token (Telegram Bot Token)
  5. Run chmod +x setup.sh && ./setup.sh or bash setup.sh to install and run

  6. Run systemctl status tgbotyh to check the status

  7. Run systemctl start tgbotyh to start the service

  8. Run systemctl stop tgbotyh to stop the service

  9. Run systemctl restart tgbotyh to restart the service

Manually install

  1. pip install -r requirements.txt
  2. Get tg token, ask Google or ChatGPT, need get it from BotFather
  3. export GOOGLE_GEMINI_KEY=${your_google_gemini_apikey}
  4. python tg.py ${telegram_bot_token}

HOW TO Use

  1. Type /gemini: ${message} to ask
  2. Type gemini: ${message} and upload picture to ask with picture

Note

If you don't want to use one of these command, you can use --disable-command <command> option to disable it. This option can be used multiple times.

Contribution

  • Any issue reports or PRs are welcome.
  • Before PR, use pip install -U black then black . first

Acknowledge

Appreciation

  • Thank you, that's enough. Just enjoy it.
Description
collections of yihong0618's telegram bot
Readme MIT 2.7 MiB
Languages
Python 94.3%
Shell 5.1%
Dockerfile 0.6%