1
我正在做一個在Raspberry Pi上使用Telegram的項目。目前,我正在使用XBEE在按下按鈕時讀取高輸入。目前,我可以在按下按鈕時發送短信。我打算在我的代碼中實現電報,以便它將同時發送SMS和電報消息。我還在RPI上安裝了Telegram API。如何包含代碼來啓動電報服務器併發送消息。按下按鈕時從Raspberry Pi發送報文
我的代碼如下所示,
if stat1.strip() in "Enable enable ENABLE":
try:
recipient= ()
for item in numbers:
recipient= item[0]
print recipient
gsm.send_sms(recipient, 'Panic activated!')
sendSmsNow = True
print "panic message sent"
time.sleep(5)
except Exception as e:
print e