This is simple plugin that get new messages from Telegram bot and paste its to daily journal.
- In order to start you need to create Telegram bot: https://core.telegram.org/bots#3-how-do-i-create-a-bot
Create a bot with BotFather, which is essentially a bot used to create other bots. The command you need is
/newbot. After you choose title, BotFaher give you the token. - Paste Telegram bot token into plugin settings
botToken - Be sure to add your username in
authorizedUsersarray, because your recently created bot is publicly findable and other peoples may send messages to your bot. For example"authorizedUsers": ["your_username"]. If you leave this array empty - all messages from all users will be processed! - You may adjust polling interval
pollingIntervalin milliseconds. This interval will be used to get new messages from Telegram bot - Messages will be pasted in daily journal into block with text, specified in
inboxNameproperty. Replace it in case of necessary. If you don't want to group messages, setinboxNameproperty tonull. In this case messages will be inserted directly into page block. - If
addTimestampset to true, message received time in formatHH:mmwill be added to message text, for example21:13 - Test message - Restart plugin in Logseq
- After that just open chat with your bot in Telegram and type
/startcommand - Then write any message in this chat, it will be added to your Logseq daily journal within 60 seconds (by default)
Settings with grouping:
{
"disabled": false,
"botToken": "PASTE_BOT_TOKEN_HERE",
"authorizedUsers": [],
"addTimestamp": false,
"pollingInterval": 60000,
"inboxName": "#inbox",
"inboxByChat": []
}Set inboxName with null if you don't want use groups:
{
"inboxName": null
}- Please, consider that messages will be pulled from Telegram only if Logseq desktop application running.
- If you doesn't open Logseq application more than 24 hours, messages from Telegram will be lost and you need to resend it.
For example you want to collect random thoughts as #spark and other thoughts as #plans.
- Write BotFather
/setprivacycommand and set it toDISABLED - Also check
/setjoingroupsit will beENABLED - Create new group in Telegram and add your bot there
- Write any message in this group
- In your plugin settings in
inboxByChatwill be added new object
"inboxByChat": [
{
"chatId": -111111111,
"inboxName": "#spark"
}
]- Disable plugin
- Change
inboxNamein this object to#sparkfor example - Enable plugin
- New messages received from this group will be added under
#sparktag - You can add additional groups if you want
"inboxByChat": [
{
"chatId": -111111111,
"inboxName": "#spark"
},
{
"chatId": -222222222,
"inboxName": "#plans"
}
]yarn && yarn buildin terminal to install dependencies.Load unpacked pluginin Logseq Desktop client.
MIT