# \[APP\]\[Pro\] Telegram

**URL:** <https://community.homey.app/t/app-pro-telegram/66622>\
**Category:** Apps\
**Tags:** app, flow, homey-pro\
**Created:** [July 28, 2022, 1:34pm UTC](https://community.homey.app/t/app-pro-telegram/66622 "2022-07-28T13:34:36Z")\
**Posts on this page:** 20\
**Page:** 7

<div class="post-metadata">

**Author:** ![Twan\_Veugelers](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/twan_veugelers/32/129333_2.png) [@Twan\_Veugelers](https://community.homey.app/u/Twan_Veugelers)\
**Post date:** [November 13, 2022, 1:54pm UTC](https://community.homey.app/t/app-pro-telegram/66622/122 "2022-11-13T13:54:34Z")

</div>

Hi @spkesDE

Great work until now, really love the app.  
How can I buy you a coffee? (or beer?!)

Next suggestion, Probably most users will have some kind of Logic value in their message. Better Logic now has been rebranded to Better Logic Library, where its functionality can be incorporated into any app, maybe this is something for Telegram Notifications as well.

[Better Logic Library](https://community.homey.app/t/app-pro-better-logic-library-just-some-better-logic-variable-and-library-management/5568/223)  
[BLL for Developers](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761)

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 13, 2022, 2:06pm UTC](https://community.homey.app/t/app-pro-telegram/66622/123 "2022-11-13T14:06:39Z")

</div>

> [@spkesDE](#):
>
> ### Wanna buy me a coffee ☕ or help to get the new Homey pro?
> 
> Feel free to [donate](https://www.paypal.com/paypalme/spikes022) to me for my work 🙂 It’s highly appreciated!

@Twan_Veugelers I’ll take a look into the BLL 🙂 Still waiting on athom. My old/broken homey arrive at homey tomorrow.

Edit: Currently I don’t find a use case for it. Maybe if BLL is more mature maybe there will be a use case.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 13, 2022, 6:09pm UTC](https://community.homey.app/t/app-pro-telegram/66622/124 "2022-11-13T18:09:45Z")

</div>

> [@spkesDE](#):
>
> Maybe if BLL is more mature maybe there will be a use case

Indeed BLL is just beginning 😉

I’ll be adding the custom functions, like in DC, HOOP and Watchman, into BLL this week and hope to also finish the ‘number’ function/class.

But just know, if you incorporate the decoder, which is just a few simple steps, the custom functions and number-method will be automaticly included when BLL is updated on a local Homey. There is no need to update anything on the apps that have BLL encoding included.

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 13, 2022, 6:50pm UTC](https://community.homey.app/t/app-pro-telegram/66622/125 "2022-11-13T18:50:51Z")

</div>

if I change from `app.bot.telegram.sendMessage(args.user.id, args.message)` to `app.bot.telegram.sendMessage(args.user.id, bl.decode(args.message))` it would support all of your custom tags e.g. `Send message "Hello, today is {[date("dddd")]}`

(Ofc it needs to be checked if there is a bc instance etc… but thats it?)

Also do you plan to support typescript definitions?

> <https://github.com/spkesDE/TelegramNotifications/blob/master/flow/actions/sendMessage.ts#L8>

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 13, 2022, 7:24pm UTC](https://community.homey.app/t/app-pro-telegram/66622/126 "2022-11-13T19:24:37Z")

</div>

> [@spkesDE](#):
>
> app.bot.telegram.sendMessage(args.user.id, bl.decode(args.message))

Indeed yeah!

Dont forget the await before the bl.decode (it’s an async method).

And you need the setup steps:

- Add the permission to your app.json  
`"permissions": ["homey:app:net.i-dev.betterlogic"]`
- Import the BL module in the app.js:.  
`const { BL } = require('../../lib/bll/bl');`
- Initialize the BLL in the app.js onInit:  
`let bl = await new BL({homey:this.homey, silent:true]});`
- Create a file /lib/bll/bll-loader.js and place the next code into it:

Source

> [@\[APP\]\[Pro\] Better Logic Library - For developers](https://community.homey.app/t/app-pro-better-logic-library-for-developers/71761/3):
>
> How to include the Better Logic Library? The Basic There are just a few simple steps to start with the most basic: include the BLL and initialize it: Add BLL through NPM. [npm install betterlogiclibrary](https://www.npmjs.com/package/betterlogiclibrary) Add the permission to your app.json "permissions": ["homey:app:net.i-dev.betterlogic"] Import the BL module in the app.js:. const { BL } = require('betterlogiclibrary'); Initialize the BL in the app.js onInit: await BL.init({homey:this.homey}); There will be no error’s thrown if BLL i…

But beside those few steps, yeah it’s just a matter of running it through the await bl.decode.  
It will be run through the AppApi on the BLL app, so you don’t need to include anything.

If you would ever need the DateTime to convert a lott of dates to show in a app settings or something like that, the Datetime module is a beter use, because it runs within your own app and only sync’s the BLL app settings.

But for the BLL decoding in text-arguments, its just a simple inlude into your app and than the simple bl.decode 🙂 .

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [November 13, 2022, 7:32pm UTC](https://community.homey.app/t/app-pro-telegram/66622/127 "2022-11-13T19:32:50Z")

</div>

> [@spkesDE](#):
>
> Also do you plan to support typescript definitions?

TypeScript definitions.  
I am not very knowegable about that, but im not sure if you really mean TypeScripts or JSDoc info?

The BL.js i post on the topic is in Javascript and i am not (yet/currently) thinking about chaning that to TypeScript (because i don’t have the expirience yet).

But i am already working (and have a big part ready) on the jsdoc file, so you will get “intellisense”.  
Is that what you ment?

Or is it really about the BL.js needs to be in TypeScript (definitions)?

Addition:  
You can combine TS and Javascript in the same app right?  
If you have a TS App, you could still include, reference and use the BL.js, right?

(I am not a native TS or Javascript expert, so no idea yet. I ofc. will be looking into TS when i have some more time and a spare Homey to start rewriting apps, but that’s gonna take some time).

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 13, 2022, 7:38pm UTC](https://community.homey.app/t/app-pro-telegram/66622/128 "2022-11-13T19:38:03Z")

</div>

Oh it’s used to provide typescript type information about an API that’s written in JavaScript.  
Check it out here. Then you can include the d.ts files into your npm package.

If I don’t have these typescript definitions I’ll have to tell the compiler to ignore the lines, what is quite annoying.

> **[Documentation - Creating .d.ts Files from .js files](https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html)**
>
> How to add d.ts generation to JavaScript projects

---

<div class="post-metadata">

**Author:** ![dooniem](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dooniem/32/58384_2.png) [@dooniem](https://community.homey.app/u/dooniem)\
**Post date:** [November 17, 2022, 8:27pm UTC](https://community.homey.app/t/app-pro-telegram/66622/129 "2022-11-17T20:27:28Z")

</div>

Hmmm. Stuck.  
My goal is to setup Siri on iOS Shortcuts to send a message to my Homey connected bot.  
So I build a URL and finish the message through speech.  
It seemed easier to send messages through URL from a bot than sending from my own username, so I made a new bot…  
Both bots were present in the group when I sent `/start`.

But since messages from the “helper\_bot” show up in the group chat, but isn’t received by homey, even after sending `/start` from the helper\_bot, I guess also bots has to “press the button below”?

Any idea how to help me? Or do you know how to send a message from my own account through URL? 😅

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 17, 2022, 8:43pm UTC](https://community.homey.app/t/app-pro-telegram/66622/130 "2022-11-17T20:43:20Z")

</div>

So you have 1 Group with 2 bots + yourself?  
And you want to read the messages from the other bot Inside the group?  
Then you have to change to bot privacy mode.

```auto
'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.

```

Send to the @botfather bot `/setprivacy` and put the homey bot to `DISABLED`  
Then your Homey Telegram bot can read messages inside the group

---

<div class="post-metadata">

**Author:** ![dooniem](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dooniem/32/58384_2.png) [@dooniem](https://community.homey.app/u/dooniem)\
**Post date:** [November 17, 2022, 8:53pm UTC](https://community.homey.app/t/app-pro-telegram/66622/131 "2022-11-17T20:53:33Z")

</div>

> [@spkesDE](#):
>
> So you have 1 Group with 2 bots + yourself?

Correct.

> [@spkesDE](#):
>
> `/setprivacy` and put the homey bot to `DISABLED`

If we call them Bot#1 and Bot#2. Bot#1 is connected to Homey. I set `/setprivacy = disabled`. Still not working. Which makes sense? If I send “test” (no “/”) from my own account, Homey detects it. If I do the same from Bot#2, it doesn’t.

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 17, 2022, 8:56pm UTC](https://community.homey.app/t/app-pro-telegram/66622/132 "2022-11-17T20:56:56Z")

</div>

Okay, I did some research. [Telegram doesn’t allow to read bot’s to read other bots messages.](https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/6/76396831c4141c78c3a6a533c71ec7feb0095693.png)  
So you have to change your system that the messages are sent from your account.

---

<div class="post-metadata">

**Author:** ![dooniem](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dooniem/32/58384_2.png) [@dooniem](https://community.homey.app/u/dooniem)\
**Post date:** [November 17, 2022, 9:04pm UTC](https://community.homey.app/t/app-pro-telegram/66622/133 "2022-11-17T21:04:32Z")

</div>

Bah. Bummer. Since you seem to be well versed in Telegram.  
Do you mind helping me build a URL to send a message from myself?  
I’ve tried reading TDLib and sendMessage, but got none the wiser. Maybe it’s not possible? 😅  
I will be able to get my APP ID and ID HASH myself, but my googling has only resulted in Python code and left me none the wiser…

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 17, 2022, 9:18pm UTC](https://community.homey.app/t/app-pro-telegram/66622/134 "2022-11-17T21:18:59Z")

</div>

You want to send a message via Siri to your homey/telegram chat?

If that’s the case. sadly there is only a way to send it to a contact/phone number not a group/bot.  
Sadly telegram doesn’t support iOS Shortcuts that well. Maybe ask in the #questions-help area if someone else found a way to send a payload to homey via Siri shortcuts. Telegram will currently not work.

---

<div class="post-metadata">

**Author:** ![dooniem](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dooniem/32/58384_2.png) [@dooniem](https://community.homey.app/u/dooniem)\
**Post date:** [November 17, 2022, 9:31pm UTC](https://community.homey.app/t/app-pro-telegram/66622/135 "2022-11-17T21:31:51Z")

</div>

> [@spkesDE](#):
>
> You want to send a message via Siri to your homey/telegram chat?

Yeah basically update a variable through speech is what I’m aiming for.  
I came THIS close. Message is sent through voice, is seen inside the correct chat, but not received by Homey 😅  
I’ll ask a question on the forum you linked me to. Thanks.

Great app though! Not your fault 😅 Must make do with opening Telegram until I find a way

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [November 28, 2022, 12:28am UTC](https://community.homey.app/t/app-pro-telegram/66622/136 "2022-11-28T00:28:03Z")

</div>

Just a little teaser 🙂 Still no homey, but I can develop some stuff without it.  
I hope the shipping will start soon of the new homeys!

FYI: Telegram Notification will require v8.1.0 or higher with the next update. Also it will include some nice stuff for @JB2K. (Deletion Question/messages, Custom IDs and some little QoL improvements)  
And it will support BLL from @Arie_J_Godschalk if everything goes according to plan.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/3/933a5ae37dcf385841204498f3e0d81afe40e033.png) ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/3/135ad649894d98e2f23fc0c659dfd290e120b254.png)

---

<div class="post-metadata">

**Author:** ![j\_wak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/j_wak/32/56668_2.png) [@j\_wak](https://community.homey.app/u/j_wak)\
**Post date:** [December 5, 2022, 12:24pm UTC](https://community.homey.app/t/app-pro-telegram/66622/137 "2022-12-05T12:24:18Z")

</div>

Hi, newbie user to TN, I am wondering if questions/answers could be managed directly from the flows like BLL new handling of variables from flows? Or is it not possible?

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [December 5, 2022, 2:00pm UTC](https://community.homey.app/t/app-pro-telegram/66622/138 "2022-12-05T14:00:17Z")

</div>

Hey, currently only possible via the settings menu, since its a one time thing.

But there will be a new card soon where you can select a question that is pre defined and select the answers per dropdown.

---

<div class="post-metadata">

**Author:** ![j\_wak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/j_wak/32/56668_2.png) [@j\_wak](https://community.homey.app/u/j_wak)\
**Post date:** [December 5, 2022, 2:19pm UTC](https://community.homey.app/t/app-pro-telegram/66622/139 "2022-12-05T14:19:24Z")

</div>

aaah nice! but defining a question in the flow directly without having to go into the settings menu will not be possible?

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [December 5, 2022, 2:25pm UTC](https://community.homey.app/t/app-pro-telegram/66622/140 "2022-12-05T14:25:22Z")

</div>

Would be possible to develop, but currently not planed.

---

<div class="post-metadata">

**Author:** ![j\_wak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/j_wak/32/56668_2.png) [@j\_wak](https://community.homey.app/u/j_wak)\
**Post date:** [December 5, 2022, 2:41pm UTC](https://community.homey.app/t/app-pro-telegram/66622/141 "2022-12-05T14:41:39Z")

</div>

okedoke 🙂 thank you for the reply! have a nice week 🙂

[Previous page](https://community.homey.app/t/app-pro-telegram/66622.md?page=6)

[Next page](https://community.homey.app/t/app-pro-telegram/66622.md?page=8)
