I am writing a code for a telegram bot on video, and very quickly, as there. I'm new to this, and I need to show this bot in 5 hours. Help, please, with occurrence of a problem.As I understand it, there are some problems in the spaces between the lines, I will be very grateful if you help me as soon as possible
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters.state import State, StatesGroup
from aiogram import types, Dispatcher
from create_bot import dp, bot
from aiogram.dispatcher.filters import Text
from data_base import sqlite_db
from keyboards import admin_kb
ID = None
class FSMAdmin(StatesGroup):
photo = State()
name = State()
description = State()
#@dp.message_handler(commands=['moderator'], is_chat_admin=True)
async def make_changes_command(message: types.Message):
global ID
ID = message.from_user.id
await bot.send_message(message.from_user.id, 'Слушаю тебя, барон')#, reply_markup=button_case_admin)
await message.delete()
# @dp.message_handler(commands='Загрузить', state=None)
async def cm_start(message : types.Message):
if message.from_user.id == ID:
await FSMAdmin.photo.set()
await message.reply('Загрузи фото')
#@dp.message_handler(content_types=['photo'], state=FSMAdmin.photo)
async def load_photo(message: types.Message, state: FSMContext):
if message.from_user.id == ID:
async with state.proxy() as data:
data['photo'] = message.photo[0].file_id
await FSMAdmin.next()
await message.reply("Теперь введи название")
#@dp.message_handler(state=FSMAdmin.name)
async def load_name(message: types.Message, state: FSMContext):
if message.from_user.id == ID:
async with state.proxy() as data:
data['name'] = message.text
await FSMAdmin.next()
await message.reply("Введи описание")
async def load_description(message: types.Message, state: FSMContext):
if message.from_user.id == ID:
async with state.proxy() as data:
data['description'] = message.text
await FSMAdmin.next()
await sqlite.db.sql_add_command(state)
await state.finish()
def register_handlers_admin(dp : Dispatcher):
dp.register_message_handler(cm_start, commands=['Загрузить'], state=None)
dp.register_message_handler(load_photo, content_types=['photo'], state=FSMAdmin.photo)
dp.register_message_handler(load_name, state=FSMAdmin.name)
dp.register_message_handler(load_description, state=FSMAdmin.description)
dp.register_message_handler(make_changes_command, commands=['moderator'], is_chat_admin=True)
Tried to change spaces and indents