Telethon icon indicating copy to clipboard operation
Telethon copied to clipboard

Argument of type "None" cannot be assigned to parameter "buttons" of type "MarkupLike"

Open MuhammadSawalhy opened this issue 2 years ago • 0 comments

Checklist

  • [x] The error is in the library's code, and not in my own.
  • [x] I have searched for this issue before posting it and there isn't a duplicate.
  • [x] I ran pip install -U https://github.com/LonamiWebs/Telethon/archive/master.zip and triggered the bug in the latest version.

I am using pyright for static checking and lining with coc-pyright. But it seems that you miss-typed the buttons argument in the send_message and the send_file methods.

image

I fixed that by editing the code of this package directly like this:

-            buttons: 'hints.MarkupLike' = None,
+            buttons: 'hints.MarkupLike' | None = None,

MuhammadSawalhy avatar Mar 09 '22 09:03 MuhammadSawalhy