This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Telegram message with blocking
#2
event.getvalue() does not accept any arguments. You need to use grp.getvalue() for all other groups than the event source.
Your script blocks multiple "on" messages but does not block "off" messages. Use this instead:
Code:
require('user.telegram')

key = 'boiler_status'

curr = event.getvalue()
prev = storage.get(key)

if curr ~= prev then
  message = curr and 'boiler on' or 'boiler off'
  telegram(message)
  storage.set(key, curr)
end
Reply


Messages In This Thread
Telegram message with blocking - by AlexLV - 30.10.2022, 18:47
RE: Telegram message with blocking - by admin - 31.10.2022, 07:09

Forum Jump: