yihong 529a5de0ff
Merge pull request #26 from linuxyz/main
Make bot react more actively
2024-04-02 21:23:31 +08:00
2024-03-05 15:51:21 +08:00
2024-03-29 11:57:33 -04:00
2024-03-24 01:20:24 +08:00
2023-12-14 19:59:18 +08:00
2023-12-17 19:53:23 +08:00
2023-12-11 19:18:55 +08:00
2024-03-18 16:11:21 +08:00
2024-03-24 01:20:24 +08:00
fix
2024-03-18 18:49:02 +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

Bot -> Claude 3

  1. visit https://console.anthropic.com/ get the key
  2. export ANTHROPIC_API_KEY=${the_key}
  3. use claude: ${message} to ask

Note, if you are using third party service, you need to export ANTHROPIC_BASE_URL=${the_url} to change the url.

Bot -> lingyiwanwu

  1. visit https://platform.lingyiwanwu.com/apikeys get the key
  2. export YI_API_KEY=${the_key}
  3. export YI_BASE_URL=${the_url}
  4. use yi: ${message} to ask

image

HOW TO Install and Run

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}

Run from Docker

build docker image

docker build -t tg_bot_collections .

Run Gemini

docker run -d --name tg_bot_collections -e GOOGLE_GEMINI_KEY='${GOOGLE_GEMINI_KEY}' -e TELEGRAM_BOT_TOKEN='${TELEGRAM_BOT_TOKEN}' --network host tg_bot_collections

Run Claude 3

docker run -d --name tg_bot_collections -e ANTHROPIC_API_KEY='${ANTHROPIC_API_KEY}' -e TELEGRAM_BOT_TOKEN='${TELEGRAM_BOT_TOKEN}' --network host tg_bot_collections

Run lingyiwanwu

docker run -d --name tg_bot_collections -e YI_API_KEY='${YI_API_KEY}' -e YI_BASE_URL='${YI_BASE_URL}' -e TELEGRAM_BOT_TOKEN='${TELEGRAM_BOT_TOKEN}' --network host tg_bot_collections

Run as shell

Note, this may break your system config -> check this https://github.com/yihong0618/tg_bot_collections/issues/5

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%