shady2k / logseq-inbox-telegram-plugin

MIT License
78 stars 5 forks source link

Plugin does not react #31

Closed noadminonly closed 1 year ago

noadminonly commented 1 year ago

Actually, you can't do anything wrong when configuring the plug-in. I entered the bot token, restarted the plugin in logseq (and then logseq itself). Then the bot was started. When I send a message now, nothing arrives in logseq. The desktop app is running. Any idea what is going wrong?

shady2k commented 1 year ago

Try this: Write BotFather /setprivacy command and set it to DISABLED

noadminonly commented 1 year ago

Hello I did this

BotFather, [04.01.23 16:31] 'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username. 'Disable' - your bot will receive all messages that people send to groups. Current status is: ENABLED

XXX, [04.01.23 16:32] Disable

BotFather, [04.01.23 16:32] Success! The new status is: DISABLED. /help

I restartet logseq and send some telegramm-Messages but nothing happens...

saccohuo commented 1 year ago

Try this: Write BotFather /setprivacy command and set it to DISABLED

Recently it cannot works. I tried this, it don't works either. logseq version:0.8.15

shady2k commented 1 year ago

By default, it fetches new messages once after 3 seconds of the plugin starting and then every minute. Can you post the json settings of your plugin here? Don't forget to replace bot token with some other text.

noadminonly commented 1 year ago

-- | -- botToken | bot-token.... pollingInterval | 60000 inboxName | "#inbox" authorizedUsers | [] addTimestamp | false invertMessagesOrder | false inboxByChat | [] isDebug | false disabled | false

shady2k commented 1 year ago

No, that's not what I asked for. Go to the plugin settings, and in the top right corner, you will see a link labeled "Edit settings.json". Click on it and you will be able to view the plugin settings. Please paste them here.

noadminonly commented 1 year ago

If i do like you describe I get this entrys

{ "botToken": "Her ist my bot token", "pollingInterval": 60000, "inboxName": "#inbox", "authorizedUsers": [], "addTimestamp": false, "invertMessagesOrder": false, "inboxByChat": [], "isDebug": false, "disabled": false }

shady2k commented 1 year ago

It seems correct. Let's do following steps:

  1. Disable plugin
  2. Turn on debug mode in plugin settings
  3. Press Ctrl + Shift + I to open developer console
  4. Enable plugin
  5. Paste here output from console
noadminonly commented 1 year ago

I hope this is helps:

it starts with some entrys:

api.telegram.org/bot5627263008: XX Bot -Token XX /getUpdates:1 Failed to load resource:

an dann ...

Failed to load resource: net::ERR_NETWORK_CHANGED d resource: net::ERR_NETWORK_CHANGED index.1ca59d04.js:1 [Inbox Telegram] Started! index.1ca59d04.js:1 [Inbox Telegram] Polling started! index.1ca59d04.js:1 Processing index.1ca59d04.js:1 {messages: Array(0)} index.1ca59d04.js:1 [Inbox Telegram] Started! index.1ca59d04.js:1 [Inbox Telegram] Polling started! index.1ca59d04.js:1 Processing index.1ca59d04.js:1 {messages: Array(0)}messages: [][[Prototype]]: Object index.1ca59d04.js:1 Processing index.1ca59d04.js:1 {messages: Array(0)}messages: Array(0)[[Prototype]]: Object index.1ca59d04.js:1 Processing index.1ca59d04.js:1 {messages: Array(0)} instrument.js:191 D:Search > Transact pages!: logseqlocal/Users/uwe/Library/Mobile Documents/iCloud~com~logseq~logseq/Documents/Logseq_First_Database index.1ca59d04.js:1 [Inbox Telegram] Started! index.1ca59d04.js:1 [Inbox Telegram] Polling started! index.1ca59d04.js:1 Processing index.1ca59d04.js:1 {messages: Array(0)}messages: [][[Prototype]]: Objectconstructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()defineGetter: ƒ defineGetter()defineSetter: ƒ defineSetter()lookupGetter: ƒ lookupGetter()lookupSetter: ƒ lookupSetter()proto: (...)get proto: ƒ proto()set proto: ƒ proto() index.1ca59d04.js:1 Processing index.1ca59d04.js:1 {messages: Array(0)}messages: [][[Prototype]]: Objectconstructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()defineGetter: ƒ defineGetter()defineSetter: ƒ defineSetter()lookupGetter: ƒ lookupGetter()lookupSetter: ƒ lookupSetter()proto: (...)get proto: ƒ proto()set proto: ƒ proto()

shady2k commented 1 year ago

It seems that no new messages in your bot chat.

noadminonly commented 1 year ago

Thats strange. I start the Bot and send several Test [messages....]() 5D9EE085-222E-49C9-95A3-55E275D84AC5

andyw8 commented 1 year ago

I'm having the same problem. I see it polling but the messages array is always empty.

shady2k commented 1 year ago

Very strange. Try to open this link in your browser https://api.telegram.org/bot${botToken}/getUpdates, replace ${botToken} with you bot token. Can you see any messages?

noadminonly commented 1 year ago

After i set my bot token.

ok | false -- | -- error_code | 404 description | "Not Found"
andyw8 commented 1 year ago

@shady2k I get:

{"ok":true,"result":[]}
andyw8 commented 1 year ago

But if I send a message, then reload, I do see it:

{"ok":true,"result":[{"update_id":4688632,
"message":{"message_id":34,"from":{"id":5915182488,"is_bot":false,"first_name":"Andy","last_name":"Waite","language_code":"en"},"chat":{"id":5915182488,"first_name":"Andy","last_name":"Waite","type":"private"},"date":1673217985,"text":"hello world"}}]}

(then when I refresh it shows an empty array again).

byheaven commented 1 year ago

I met the same problem. Sending messages directly to the bot is not working. Then I added the bot in a private channel and set as admin. Now it works perfectly. Hope it helps.

noadminonly commented 1 year ago

That sounds interesting. Can you explain/describe how you did that

added the bot in a private channel and set as admin.

Thanks

byheaven commented 1 year ago

Just create a channel and add your bot

noadminonly commented 1 year ago

Thanks for the tip, that works for me too, so that completes the process for me.