Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sampleproject not working #32

Open
ilmenshik opened this issue Jul 2, 2019 · 2 comments
Open

sampleproject not working #32

ilmenshik opened this issue Jul 2, 2019 · 2 comments

Comments

@ilmenshik
Copy link

Every time I try to run sampleproject from the repository, the bot does not work.
The application starts, but the bot does not work.
If I change the code without shutting down, django will reread the files and the bot will start working.

I tried to call main() in wsgi.py, but only got an error: list index out of range
here: https://github.com/JungDev/django-telegrambot/blob/master/django_telegrambot/apps.py#L47

How to make the bot work at the start (after manage.py runserver)?

@JungDev
Copy link
Owner

JungDev commented Sep 7, 2019

Do you have a valid bot token in your config?

@lukruh
Copy link
Contributor

lukruh commented Apr 22, 2020

How to make the bot work at the start (after manage.py runserver)?

If you have added the bot token in settings.py and configured it to use webhooks, it should be enough to call manage.py runserver. For bot polling you have to start the bot with manage.py botpolling --username=<botusername>.

Make sure the module name (folder which contains telegrambot.py) is added to installed apps and matches your bots username (@... not the displayed name) in the command and in your main function.

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

No branches or pull requests

3 participants