Docker
0
Вклад в тег
FROM python:3.11.0
# Set the working directory
WORKDIR /usr/src/app
# Copy the application files
COPY ./files/ ./
# Install Russian locales
RUN apt-get update && \
apt-get install -y locales && \
echo "ru_RU.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen && \
update-locale LANG=ru_RU.UTF-8
ENV LANG=ru_RU.UTF-8 \
LANGUAGE=ru_RU:ru \
LC_ALL=ru_RU.UTF-8
# Install Python dependencies
RUN pip install -r req.txt
from telethon import TelegramClient
import asyncio
import threading
async def send_message():
loop = asyncio.new_event_loop()
api_id = 555
api_hash = '555555555'
client = TelegramClient('55555555.session', api_id, api_hash, loop=loop)
async with client:
await client.send_message('+55555555', '123')
def go():
asyncio.run(send_message())
threading.Thread(target=go).start()