Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Can't start bot - TypeError: __init__() missing 2 required positional arguments: 'scope' and 'lang_code' #12

Open
DaCaemboe opened this issue Aug 27, 2021 · 1 comment

Comments

@DaCaemboe
Copy link

Hi there,

I've installed all modules and filled in the API keys etc, but I get the following error:

Image exists
Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\Scripts\telewater.exe\__main__.py", line 7, in <module>
  File "c:\python39\lib\site-packages\typer\main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "c:\python39\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\python39\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\python39\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python39\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\python39\lib\site-packages\typer\main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "c:\python39\lib\site-packages\telewater\cli.py", line 102, in main
    start_bot(API_ID, API_HASH, name, token)
  File "c:\python39\lib\site-packages\telewater\main.py", line 23, in start_bot
    functions.bots.SetBotCommandsRequest(
TypeError: __init__() missing 2 required positional arguments: 'scope' and 'lang_code'

Looking forward to your assistance!

Best regards

@DaCaemboe DaCaemboe changed the title Can't start bot Can't start bot - TypeError: __init__() missing 2 required positional arguments: 'scope' and 'lang_code' Aug 27, 2021
@rjadr
Copy link

rjadr commented Nov 21, 2021

You have to set scope and lang_code as well in main.py, see: https://tl.telethon.dev/methods/bots/set_bot_commands.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants