Skip to content

Commit

Permalink
fix typo: pooling -> polling
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Shamaev committed Sep 8, 2022
1 parent 007f6b0 commit 6760f45
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Sexy Django + python-telegram-bot + Celery + Redis + Postgres + Dokku + GitHub A
* Admin panel (thanks to [Django](https://docs.djangoproject.com/en/3.1/intro/tutorial01/))
* Background jobs using [Celery](https://docs.celeryproject.org/en/stable/)
* [Production-ready](https://github.com/ohld/django-telegram-bot/wiki/Production-Deployment-using-Dokku) deployment using [Dokku](https://dokku.com)
* Telegram API usage in pooling or [webhook mode](https://core.telegram.org/bots/api#setwebhook)
* Telegram API usage in polling or [webhook mode](https://core.telegram.org/bots/api#setwebhook)
* Reverse geocode of user via [ArcGis](https://www.arcgis.com/)
* Export all users in `.csv`
* Native telegram [commands in menu](https://github.com/ohld/django-telegram-bot/blob/main/.github/imgs/bot_commands_example.jpg)
Expand All @@ -28,9 +28,9 @@ Check out our [Wiki](https://github.com/ohld/django-telegram-bot/wiki) for more

# How to run

## Quickstart: Pooling & SQLite
## Quickstart: Polling & SQLite

The fastest way to run the bot is to run it in pooling mode using SQLite database without all Celery workers for background jobs. This should be enough for quickstart:
The fastest way to run the bot is to run it in polling mode using SQLite database without all Celery workers for background jobs. This should be enough for quickstart:

``` bash
git clone https://github.com/ohld/django-telegram-bot
Expand Down Expand Up @@ -65,9 +65,9 @@ Create superuser to get access to admin panel:
python manage.py createsuperuser
```

Run bot in pooling mode:
Run bot in polling mode:
``` bash
python run_pooling.py
python run_polling.py
```

If you want to open Django admin panel which will be located on http://localhost:8000/tgadmin/:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
bot:
build: .
container_name: dtb_bot
command: python run_pooling.py
command: python run_polling.py
env_file:
- ./.env
depends_on:
Expand Down
4 changes: 2 additions & 2 deletions run_pooling.py → run_polling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dtb.settings')
django.setup()

from tgbot.dispatcher import run_pooling
from tgbot.dispatcher import run_polling

if __name__ == "__main__":
run_pooling()
run_polling()
6 changes: 3 additions & 3 deletions tgbot/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def setup_dispatcher(dp):
return dp


def run_pooling():
""" Run bot in pooling mode """
def run_polling():
""" Run bot in polling mode """
updater = Updater(TELEGRAM_TOKEN, use_context=True)

dp = updater.dispatcher
Expand All @@ -86,7 +86,7 @@ def run_pooling():
bot_info = Bot(TELEGRAM_TOKEN).get_me()
bot_link = f"https://t.me/" + bot_info["username"]

print(f"Pooling of '{bot_link}' started")
print(f"Polling of '{bot_link}' has started")
# it is really useful to send '👋' emoji to developer
# when you run local test
# bot.send_message(text='👋', chat_id=<YOUR TELEGRAM ID>)
Expand Down

0 comments on commit 6760f45

Please sign in to comment.