telegram you are fucking weird

This commit is contained in:
blank X 2020-10-30 13:17:39 +07:00
parent cc35888b62
commit 4865b970e3
1 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,7 @@ import aiohttp
import aiocron import aiocron
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from telethon import TelegramClient, events from telethon import TelegramClient, events
from telethon.utils import chunks from telethon.utils import chunks, is_list_like
with open('config.yaml') as file: with open('config.yaml') as file:
config_data = yaml.safe_load(file) config_data = yaml.safe_load(file)
@ -202,6 +202,10 @@ async def main():
k = None k = None
if not k and len(j) == 1: if not k and len(j) == 1:
j = j[0] j = j[0]
if is_list_like(j) and is_list_like(k):
if len(j) == 1 and len(k) == 1:
j = j[0]
k = k[0]
await client.send_message(chat, j, file=k, link_preview=False) await client.send_message(chat, j, file=k, link_preview=False)
async def _download_file(filename, url): async def _download_file(filename, url):