Collections of yihong0618's telegram bot
for yihong0618's channel: https://t.me/hyi0618
- install font wqy-microhei first
- use
fake: ${message}
to generate
Bot -> ChatTTS
- export USE_CHATTTS=true
- use
tts: ${message}
to generate
- visit https://makersuite.google.com/app/apikey get the key
- export GOOGLE_GEMINI_KEY=${the_key}
- use
gemini: ${message}
to ask
- visit https://console.anthropic.com/ get the key
- export ANTHROPIC_API_KEY=${the_key}
- 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.
- visit https://platform.lingyiwanwu.com/apikeys get the key
- export YI_API_KEY=${the_key}
- export YI_BASE_URL=${the_url}
- use
yi: ${message}
to ask
- visit https://platform.openai.com/account/api-keys get the key
- export OPENAI_API_KEY=${the_key}
- use
gpt: ${message}
to ask
Note, if you are using third party service, you need to export OPENAI_API_BASE=${the_url}
to change the url.
- visit https://console.groq.com/docs/quickstart get the key
- export GROQ_API_KEY=${the_key}
- use
llama_pro: ${message}
to ask
- visit https://api.together.xyz/settings/api-keys get the key
- export TOGETHER_API_KEY=${the_key}
- use
qwen_pro: ${message}
to ask
- visit https://cloud.dify.ai/ get selected Chatbot's API Secret key
- export DIFY_API_KEY=${the_key}
- use
dify: ${message}
to ask
Note, currently its support dify Chatbot with instructions(System prompt) and different MODEL with its parameters.
- visit https://dashboard.cohere.com/api-keys get the key
- export COHERE_API_KEY=${the_key}
- use
cohere: ${message}
to ask
You do not need to do anything.
But you may not be able to edit any generated post since you do not have the token.
Change "Store_Token" to "True" in "handlers/init.py" TelegraphAPI/_create_ph_account. It will store the token in "token_key.json".
- https://t.me/telegraph Create or login Telegraph account
Log in as ${Account} on this device
- On Browser at https://telegra.ph/, press F12 or right click and inspect
- Go to Application -> Storage -> Cookies -> https://telegra.ph/
- The token at
tph_token
is the token for telegra.ph API
Do not share the token with others, it's like a password.
- pip install -r requirements.txt
- Get tg token, ask Google or ChatGPT, need get it from BotFather
- export GOOGLE_GEMINI_KEY=${your_google_gemini_apikey}
- python tg.py ${telegram_bot_token}
docker build -t tg_bot_collections .
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
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
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
docker run -d --name tg_bot_collections -e OPENAI_API_KEY='${CHATGPT_API_KEY}' -e TELEGRAM_BOT_TOKEN='${TELEGRAM_BOT_TOKEN}' --network host tg_bot_collections
Note, this may break your system config -> check this yihong0618#5
- Type
/gemini: ${message}
to ask - 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.
- Any issue reports or PRs are welcome.
- Before PR, use
pip install -U black
thenblack .
first
- poster use my repo -> https://github.com/yihong0618/GitHubPoster
- pretty map use wonder repo -> https://github.com/chrieke/prettymapp
- Gemini use -> https://github.com/google/generative-ai-python
- Telegram markdownV2 change code copy from https://github.com/yym68686/md2tgmd/blob/main/src/md2tgmd.py thanks a lot.
- Telegram markdownV2 change to telegramify-markdown
- ChatGPT use -> https://github.com/openai/openai-python
- Thank you, that's enough. Just enjoy it.