benerin posisi flag supaya bisa di pakai di follow mauapun mention
This commit is contained in:
parent
8de74a7ba5
commit
3cde26d4f0
1 changed files with 15 additions and 15 deletions
28
main.py
28
main.py
|
@ -67,19 +67,6 @@ async def kirim_ke_tele():
|
|||
|
||||
|
||||
for notif in cek_data:
|
||||
if str(notif.type) == 'follow':
|
||||
try:
|
||||
await bot.send_message(parse_mode='html',chat_id=str(TELE_CHATID), text=f"""
|
||||
<b>{notif.display_name}</b>\n<i>{notif.handler}</i>\n{flag}
|
||||
"""
|
||||
)
|
||||
except:
|
||||
print('Ada masalah saat kirim ke Telebot')
|
||||
else:
|
||||
html_strip = re.compile('<.*?>')
|
||||
status = str(notif.status)
|
||||
status_text = re.sub(html_strip,'', status)
|
||||
|
||||
def icon_(type_):
|
||||
if type_ == 'mention':
|
||||
return '💬 mention your note'
|
||||
|
@ -94,6 +81,19 @@ async def kirim_ke_tele():
|
|||
|
||||
flag = icon_(notif.type)
|
||||
|
||||
if str(notif.type) == 'follow':
|
||||
try:
|
||||
await bot.send_message(parse_mode='html',chat_id=str(TELE_CHATID), text=f"""
|
||||
<b>{notif.display_name}</b>\n<i>{notif.handler}</i>\n{flag}
|
||||
"""
|
||||
)
|
||||
except:
|
||||
print('Ada masalah saat kirim ke Telebot')
|
||||
else:
|
||||
html_strip = re.compile('<.*?>')
|
||||
status = str(notif.status)
|
||||
status_text = re.sub(html_strip,'', status)
|
||||
|
||||
try:
|
||||
await bot.send_message(parse_mode='html',chat_id=str(TELE_CHATID), text=f"""
|
||||
<b>{notif.display_name}</b>\n<i>{notif.handler}</i>\n{flag}\n\n{status_text}\n\n{notif.url}
|
||||
|
@ -104,5 +104,5 @@ async def kirim_ke_tele():
|
|||
|
||||
|
||||
|
||||
asyncio.run(getNotif())
|
||||
# asyncio.run(getNotif())
|
||||
asyncio.run(kirim_ke_tele())
|
||||
|
|
Loading…
Reference in a new issue