-
Notifications
You must be signed in to change notification settings - Fork 2
/
send_to_channel.py
36 lines (26 loc) · 1.2 KB
/
send_to_channel.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
import telegram
from tenacity import retry, retry_if_exception_type, stop_after_attempt
import time
bot = telegram.Bot(token='5135949153:AAFr8IZwDOGtCxIX1by6_VGrkFm-3d62tuY')
#@retry(retry=retry_if_exception_type(telegram.error.RetryAfter),stop=stop_after_attempt(10))
def send_main(msg):
message=msg
if(message!=''):
time.sleep(2) # Sleep for 3 seconds
status = bot.send_message(chat_id='@trading_officials', text=message, parse_mode=telegram.ParseMode.HTML)
else:
print("message is empty...........................................")
def send_ramin(msg):
message=msg
if(message!=''):
time.sleep(2) # Sleep for 3 seconds
status = bot.send_message(chat_id='@ramin_tradingofficials', text=message, parse_mode=telegram.ParseMode.HTML)
else:
print("message is empty...........................................")
def send_mina(msg):
message=msg
if(message!=''):
time.sleep(2) # Sleep for 3 seconds
status = bot.send_message(chat_id='@mina_tradingofficials', text=message, parse_mode=telegram.ParseMode.HTML)
else:
print("message is empty...........................................")