/
lucifer39
/
web_bot
Обзор
Документация
Войти
/
lucifer39
/
web_bot
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
botapp/webhooks.py
13 строк
455 B
Ilya Kuprin
первый коммит )
25 июн 2025, 21:38
25 июн 2025, 21:38
383022c
Код
Авторство
О чём код?
import telebot.types from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from .handlers import bot @csrf_exempt def telegram_webhook(request): if request.metod == 'POST': json_data = request.body.decode('utf-8') update = telebot.types.Update.de_json(json_data) bot.process_new_updates([update]) return HttpResponse("OK") return HttpResponse("Method not allowed", status=405)