super().__init__(conf, kwargs) TypeError: __init__() takes from 1 to 2 positional arguments but 3 were given

Я написал скрипт телеграм бота (библиотека aiogram) и мне выдаёт эту ошибку:

Goodbye!
Traceback (most recent call last):
  File "C:\Users\79967\PycharmProjects\pythonProject1\bot2.py", line 61, in <module>
    executor.start_polling(dp, skip_updates=True)
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\utils\executor.py", line 45, in start_polling
    executor.start_polling(
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\utils\executor.py", line 320, in start_polling
    loop.run_until_complete(self._startup_polling())
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\utils\executor.py", line 374, in _startup_polling
    await self._skip_updates()
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\utils\executor.py", line 357, in _skip_updates
    await self.dispatcher.skip_updates()
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 224, in skip_updates
    await self.bot.get_updates(offset=-1, timeout=1)
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\bot\bot.py", line 98, in get_updates
    return [types.Update(**update) for update in result]
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\bot\bot.py", line 98, in <listcomp>
    return [types.Update(**update) for update in result]
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\types\base.py", line 95, in __init__
    self.props[key].set_value(self, value, parent=self)
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\types\fields.py", line 57, in set_value
    value = self.deserialize(value, parent)
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\types\fields.py", line 115, in deserialize
    return self.base_object(conf={'parent':parent}, **value)
  File "C:\Users\79967\AppData\Local\Programs\Python\Python39\lib\site-packages\aiogram\types\message.py", line 109, in __init__
    super().__init__(conf, kwargs)
TypeError: __init__() takes from 1 to 2 positional arguments but 3 were given

Process finished with exit code 1

Я очень новичок и не понимаю что это.

Вот мой скрипт:

import time
from email import message

from sqlalchemy.engine import cursor

import config
import random

from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.dispatcher.filters import Text
from aiogram.utils import executor
from filters import IsAdminFilter

bot = Bot(token=config.TOKEN, parse_mode="html")
dp = Dispatcher(bot)

dp.filters_factory.bind(IsAdminFilter)

@dp.message_handler(commands=['start'])
async def start_message(message: types.Message):
    await message.reply("Привет, вступай в нашу группу https://t.me/obshitelniychat . Чтобы узнать что я умею введите команду /help")


@dp.message_handler(commands=['owner'])
async def start_message(message: types.Message):
    await message.reply("Мой создатель 🧑‍💻: \[email protected]_crayzy 15 y.o 🇷🇺(🇹🇯)")


@dp.message_handler(commands=['help'])
async def help_message(message: types.Message):
    await message.reply(
        "\n Мои команды (все  команды должны быть ответом на сообщение !)

 

if __name__ == '__main__':
    executor.start_polling(dp, skip_updates=True)

0 ответов

Другие вопросы по тегам