feat: Default skip telegraph account

It will print out the token in local terminal by default.

If Store_Token = True, it will store token in "token_key.json"

View my lite ver and try at <https://github.com/alterxyz/tg_bot_collections_lite>
This commit is contained in:
Alter-xyz
2024-06-24 21:26:44 -04:00
parent e2ffd7fa57
commit 9c8638279e
5 changed files with 141 additions and 219 deletions

View File

@ -17,19 +17,12 @@ markdown_symbol.link = "🔗" # If you want, Customizing the link symbol
COHERE_API_KEY = environ.get("COHERE_API_KEY")
COHERE_MODEL = "command-r-plus"
TELEGRA_PH_TOKEN = environ.get("TELEGRA_PH_TOKEN")
if TELEGRA_PH_TOKEN:
ph = TelegraphAPI(TELEGRA_PH_TOKEN)
else:
TELEGRA_PH_TOKEN = create_ph_account(
short_name="cohere", author_name="A Telegram Bot"
)
ph = TelegraphAPI(TELEGRA_PH_TOKEN)
if COHERE_API_KEY:
co = cohere.Client(api_key=COHERE_API_KEY)
TELEGRA_PH_TOKEN = environ.get("TELEGRA_PH_TOKEN")
ph = TelegraphAPI(TELEGRA_PH_TOKEN)
# Global history cache
cohere_player_dict = ExpiringDict(max_len=1000, max_age_seconds=300)