What am i doing wrong in python bot?

I don’t understand what is my mistake. Can someone show me the correct code My code: @dp.message_handler(content_types=[‘text’]) async def Text(update): dl = downloader.tiktok_downloader() global last_use meseg = update.message.text getvid = dl.musicaldown(url=meseg,output_name=’video.mp4′) if getvid: bot.send_video() return if getvid == False: getvid = dl.ttscraper(url=meseg, output_name="video.mp4") if getvid: bot.send_videoo() return else: bot.send_message(‘"failed to download video.check link and try… Read More What am i doing wrong in python bot?

[aiofiles & asyncio dont write logs in file.txt

The question is as to why it does not write certain logs to the file, errors are not shown. Bot for tg on aiogram. logs.py: import aiofiles import asyncio async def writelog(user_id: int, log: str): return async with aiofiles.open(‘assets/recently.txt’, mode=’w’) as f: await f.write(f'{user_id}:{log}\n’) async def readlogs(): return ” async with aiofiles.open(‘assets/recently.txt’, mode=’r’) as f:… Read More [aiofiles & asyncio dont write logs in file.txt

How to repair my aiogram code? Dispatcher problem

I want to have output "Hi" after entering "/Hello". It is working with @dp.message_handler(commands=["Hello"]) but isn’t with def register_handlers_client(dp : Dispatcher): dp.register_message_handler(raspisanije, commands=["Hello"]) What’s the problem? TOKEN = ‘TOKEN’ bot = Bot(token=TOKEN) dp = Dispatcher(bot) btn1 = KeyboardButton("/Hello") mainMenu1 = ReplyKeyboardMarkup(resize_keyboard = True).add(btn1) # @dp.message_handler(commands=["Hello"]) async def raspisanije(message: types.Message): await bot.send_message(message.from_user.id, "Hi") def register_handlers_client(dp :… Read More How to repair my aiogram code? Dispatcher problem

I can’t get the user id

I was writing a bot and I was dealing with this problem. Who knows how to fix it? enter image description here from aiogram import Bot, types from aiogram.dispatcher import Dispatcher from aiogram.types import message from aiogram.utils import executor import os bot = Bot(token=os.getenv(‘TOKEN’)) dp = Dispatcher(bot) #clien @dp.message_handler(commands = [‘start’, ‘help’]) async def commands_start(massage… Read More I can’t get the user id