-
Notifications
You must be signed in to change notification settings - Fork 5
/
telegram_io.py
39 lines (29 loc) · 865 Bytes
/
telegram_io.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# per installare queste librerie:
#
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import subprocess
import exchange
import time
#import os
from .telegram_credentials import *
# IMPORTANTE: inserire il token fornito dal BotFather nella seguente stringa
TOKEN=get_token()
def func_call(filename):
exec(open(filename).read(), globals(), globals())
def extract_number(text):
return text.split()[1].strip()
def nulla():
#print("attivo")
return False
#def telegram_idle():
def main():
upd= Updater(TOKEN, use_context=True)
disp=upd.dispatcher
disp.add_handler(CommandHandler("bot1", nulla))
upd.start_polling()
#while True:
#print("This prints once a minute.")
#time.sleep(1) # Delay for 1 minute (60 seconds).
#upd.idle()
if __name__=='__main__':
main()