yihong0618 / tg_bot_collections

collections of yihong0618's telegram bot
MIT License
561 stars 109 forks source link

feat: Cohere Telegraph #37

Closed alterxyz closed 3 months ago

alterxyz commented 3 months ago

Kindly try my own bot https://t.me/tealmoon_ai_v1_bot

The new feature need:

pip install beautifulsoup4 # for html to Telegraph foramte
pip install Markdown # for markdown to html
pip install cohere # Cohere

The requirements.txt and env variables are not set up yet.

yihong0618 commented 3 months ago

nice

yihong0618 commented 3 months ago

Nice work

yihong0618 commented 3 months ago

@alterxyz can we use something like

https://github.com/python273/telegraph or https://github.com/aiogram/aiograph

that user can easily use it? since telegraph do not need to login

alterxyz commented 3 months ago

What do you mean by easily use it?

Can you make some simple example about that?

yihong0618 commented 3 months ago

will dig it seems these package do not need cookie

alterxyz commented 3 months ago

Tbh creating a telegraph page is just simple request.

The issue there is convert text(markdown) to the telegra.ph format](https://telegra.ph/api#NodeElement), that why there is import for markdown and beautiful.

pip install Markdown
 pip install beautifulsoup4

A quick look is both those two does not did that.

Our latest code does not need account or cookie or token.

It will auto generate a account and store it (to a json file... not sure is it good / best practice or not) if there is no env telegraph token.

(we can even skip the store account if needed, like everytime restart it we generate a new account, if we do not need edit it in future, and btw the telegraph page can not be delete but can be edit if we have the token.)

yihong0618 commented 3 months ago

copy that and make sense

yihong0618 commented 3 months ago

Thanks