Add more amrdown and links
This commit is contained in:
parent
916d075600
commit
875562fb81
1 changed files with 8 additions and 4 deletions
|
@ -4,7 +4,8 @@ import os
|
|||
import schedule
|
||||
import time
|
||||
import requests
|
||||
from telegram import Bot
|
||||
from telegram import Bot, LinkPreviewOptions
|
||||
from telegram.constants import ParseMode
|
||||
from dotenv import load_dotenv
|
||||
from pathlib import Path
|
||||
|
||||
|
@ -34,8 +35,9 @@ async def send_to_telegram(message: str):
|
|||
return
|
||||
|
||||
bot = Bot(token=TELEGRAM_TOKEN)
|
||||
link_preview_options = LinkPreviewOptions(is_disabled=True)
|
||||
try:
|
||||
await bot.send_message(chat_id=TELEGRAM_CHANNEL, text=message)
|
||||
await bot.send_message(chat_id=TELEGRAM_CHANNEL, text=message, parse_mode=ParseMode.MARKDOWN, link_preview_options=link_preview_options)
|
||||
logger.info("Message sent successfully")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send message: {e}")
|
||||
|
@ -59,10 +61,12 @@ def job():
|
|||
data = get_signature_data()
|
||||
if data:
|
||||
percentage = (data['count'] / data['goal']) * 100
|
||||
message = f"📊 Signature Progress:\n"
|
||||
message = "📊 Signature Progress:\n"
|
||||
message += f"Current: {data['count']:,}\n"
|
||||
message += f"Goal: {data['goal']:,}\n"
|
||||
message += f"Progress: {percentage:.1f}%"
|
||||
message += f"Progress: {percentage:.1f}%\n\n"
|
||||
message += f"[SIGN HERE](https://eci.ec.europa.eu/045/public/#/screen/home)\n"
|
||||
message += f"[MORE INFORMATION](https://www.stopkillinggames.com)"
|
||||
asyncio.run(send_to_telegram(message))
|
||||
|
||||
def main():
|
||||
|
|
Loading…
Reference in a new issue