Checklist
Description
Возникло исключение: TypeError
GetForumTopics.init() got an unexpected keyword argument 'channel'
File "/Users/dken/OpenServer/domains/python/copytelegram/copy-telegram-forums.py", line 133, in list_forum_topics
topic_count += 1
...<2 lines>...
File "/Users/dken/OpenServer/domains/python/copytelegram/copy-telegram-forums.py", line 153, in
asyncio.run(list_forum_topics(from_cannel))
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GetForumTopics.init() got an unexpected keyword argument 'channel'
Steps to reproduce
test chat.FORUM
Code example
async def list_forum_topics(chat_id: int): # Параметр называется chat_id
"""
Получает и выводит список тем (топиков) в форуме Telegram.
"""
client = Client(name=SESSION_NAME, api_id=API_ID, api_hash=API_HASH)
await client.start()
print(f"Получение списка тем для чата/форума: {chat_id}")
# Используем параметр chat_id, как указано в документации[citation:1]
topics_generator = client.get_forum_topics(chat_id=chat_id)
topic_count = 0
async for topic in topics_generator:
topic_count += 1
# Выводим информацию о теме
print(f"Тема #{topic_count}: ID={topic.id}, Заголовок='{topic.title}'")
if topic_count == 0:
print("В этом чате не найдено тем. Убедитесь, что это форум.")
else:
print(f"--- Всего тем найдено: {topic_count} ---")
Logs
Checklist
pip3 install -U git+https://github.com/Mayuri-Chan/pyroforkand reproduced the issue using the latest development versionDescription
Возникло исключение: TypeError
GetForumTopics.init() got an unexpected keyword argument 'channel'
File "/Users/dken/OpenServer/domains/python/copytelegram/copy-telegram-forums.py", line 133, in list_forum_topics
topic_count += 1
...<2 lines>...
File "/Users/dken/OpenServer/domains/python/copytelegram/copy-telegram-forums.py", line 153, in
asyncio.run(list_forum_topics(from_cannel))
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: GetForumTopics.init() got an unexpected keyword argument 'channel'
Steps to reproduce
test chat.FORUM
Code example
Logs