14 lines
409 B
Python
14 lines
409 B
Python
from django.apps import AppConfig
|
|
import django.conf
|
|
import requests
|
|
|
|
|
|
class TgbotConfig(AppConfig):
|
|
default_auto_field = "django.db.models.BigAutoField"
|
|
name = "tgbot"
|
|
|
|
def ready(self):
|
|
from django.conf import settings
|
|
requests.get(f"https://api.telegram.org/bot{settings.TGBOT['token']}/setWebhook?url=https://{settings.TGBOT['base_url']}/api/tgbot/&drop_pending_updates=true")
|
|
|