21 lines
452 B
Python
21 lines
452 B
Python
"""Sticker helper."""
|
|
from aiogram import Bot
|
|
from app.config import BOT_TOKEN
|
|
from app.logger import logger
|
|
|
|
_bot = None
|
|
|
|
|
|
def _sticker_bot():
|
|
global _bot
|
|
if _bot is None:
|
|
_bot = Bot(token=BOT_TOKEN)
|
|
return _bot
|
|
|
|
|
|
async def send_sticker(chat_id, sticker_id: str):
|
|
try:
|
|
await _sticker_bot().send_sticker(chat_id, sticker=sticker_id)
|
|
except Exception as e:
|
|
logger.warning("Sticker send failed: {err}", err=e)
|