ciuzaak / Claude-Telegram-Bot

Anthropic Claude & Google Bard Bot for Telegram.
MIT License
204 stars 85 forks source link

Get configuration from environment variables #9

Closed jtsang4 closed 1 year ago

jtsang4 commented 1 year ago

@ciuzaak Thank you for your excellent work, I have deployed a Telegram bot using your code, it works great!

But I stiil have some problem, for some reason, my deployment platform only supports configurate through environment variables when deploying Github project. So I have to fork this project and modify the way to obtain config , but after doing this, I have to sync with your updates manually every time.

So is it possible to add a way to obtain the config from environment variables? I think it may also help others people like me.

ciuzaak commented 1 year ago

感谢大佬鼓励😉

现在只需要跳过创建config/config.yml这一步,bot就会默认去读取环境变量中的配置。变量名如下:

export BOT_TOKEN="your bot token"
export USER_IDS="user_id1,user_id2,..."
export CLAUDE_API="your claude api" # ignore it if you don't want to use claude
export BARD_API="your bard api" # ignore it if you don't want to use bard
jtsang4 commented 1 year ago

感谢大佬鼓励😉

现在只需要跳过创建config/config.yml这一步,bot就会默认去读取环境变量中的配置。变量名如下:

export BOT_TOKEN="your bot token"
export USER_IDS="user_id1,user_id2,..."
export CLAUDE_API="your claude api" # ignore it if you don't want to use claude
export BARD_API="your bard api" # ignore it if you don't want to use bard

感谢,好快的更新!