def monitor_promo(bot, job):
""" Job to Send Promo Message """
msg = promo_alert.get_new_codes_message()
if msg is None:
print('No new promos')
else:
text_bot = ['Uber poked me privately and said this :wink:',
'I found this promo code while I was in my ActiveWear! :stuck_out_tongue:',
'Quick apply the code! Later run out dont cry :sunglasses:',
'Breaking News Brought to you by ShiokBot!',
]
all_users = promo_alert.get_all_users()
to_send = chunks(all_users, 10)
for group in to_send:
for user in group:
try:
bot.sendMessage(int(user),
text=emojize(random.choice(text_bot), use_aliases=True),
parse_mode='HTML')
bot.sendMessage(int(user), text=msg, parse_mode='HTML')
except:
print("Error! Sending Message to " + str(user))
sleep(1.2)
评论列表
文章目录