Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@ def control(bot):

for update in bot.get_updates(offset=update_id, timeout=10):
update_id = update.update_id + 1
action_list = [[ "کنترل هوشمند", "کنترل دستی", "خاتمه"], [""]]
action_list = [[ "hey raspy"], ["hey"]]
sleep(1)
update.message.reply_text("لطفا یکی از گزینه‌های زیر را انتخاب نمائید : ", reply_markup=telegram.ReplyKeyboardMarkup(action_list, one_time_keyboard=True))
update.message.reply_text("hii, how can i help you", reply_markup=telegram.ReplyKeyboardMarkup(action_list, one_time_keyboard=True))

if update.message:
if update.message.text == "کنترل هوشمند" :
import smart
smart.main()
sleep(1)

elif update.message.text == "کنترل دستی":
elif update.message.text == "turn on led":
import manual
manual.main()
sleep(1)

elif update.message.text == "خاتمه":
import sys
#sys.exit(0)
print("salam")
print("bye")

else:
time.sleep(2)

def main():
global update_id
bot = telegram.Bot('Telegram Token')
bot = telegram.Bot('AAETnun0PVseADWv4Tb8uwQWHmjY4wPvWQ8')

try:
update_id = bot.get_updates()[0].update_id
Expand Down