There was an error while loading. Please reload this page.
1 parent 4dd0686 commit 22d9077Copy full SHA for 22d9077
2 files changed
compiler/api/compiler.py
@@ -336,7 +336,8 @@ def start(format: bool = False):
336
docstring=docstring,
337
name=type,
338
qualname=qualtype,
339
- types=", ".join([f"raw.types.{c}" for c in constructors])
+ types=", ".join([f"raw.types.{c}" for c in constructors]),
340
+ doc_name=snake(type).replace("_", "-")
341
)
342
343
compiler/api/template/type.txt
@@ -15,3 +15,9 @@ class {name}: # type: ignore
15
"""
16
17
QUALNAME = "pyrogram.raw.base.{qualname}"
18
+
19
+ def __init__(self):
20
+ raise TypeError("Base types can only be used for type checking purposes: "
21
+ "you tried to use a base type instance as argument, "
22
+ "but you need to instantiate one of its constructors instead. "
23
+ "More info: https://docs.pyrogram.org/telegram/base/{doc_name}")
0 commit comments