English | 中文
Telegram bot for the Memos project
- Photos sending is set using environment variable
INCLUDE_PHOTO
instead of using different docker image tag.
- Create a bot using @BotFather, and get your bot token.
- Get your
chatid
from @userinfobot - Get your memos API URL.
- Run the bot with the following command:
docker run -d \
--name tgmemobot \
-e BOT_TOKEN="xxx" \
-e CHAT_ID="yyy" \
-e MEMO_API="zzz" \
fwing/tgmemobot
Example usage
docker run -d \
--name tgmemobot \
-e BOT_TOKEN="588859xyz:xyz" \
-e CHAT_ID="470183200" \
-e MEMO_API="https://example.com/api/memo?openId=xyz" \
fwing/tgmemobot
Add INCLUDE_PHOTO=True
to the environment variables to enable photo support.
docker run -d \
--name tgmemobot \
-e INCLUDE_PHOTO=True \
......
However, due to limited API, message with multiple photos will be considered as multiple single photo message, which leads to multiple text memos with only one message sent! This may lead to undesired behaviour.
PRs are welcome!
Set TG_API_URL
in the environment variables to use a custom Telegram API endpoint.
For example
docker run -d \
--name tgmemobot \
-e TG_API_URL="https://workers.dev/bot" \
......
Notice that it should end with /bot
.
You will need a server that can access telegram services to run this bot. Or alternatively, you can use a custom Telegram API endpoint.