20
20
@staff_member_required
21
21
def home (request ):
22
22
bot_list = DjangoTelegramBot .bots
23
- context = {'bot_list' : bot_list , 'update_mode' :settings .DJANGO_TELEGRAMBOT .get ('MODE' , 'WEBHOOK' )}
23
+ context = {'bot_list' : bot_list , 'update_mode' : settings .DJANGO_TELEGRAMBOT .get ('MODE' , 'WEBHOOK' )}
24
24
return render (request , 'django_telegrambot/index.html' , context )
25
25
26
26
@@ -30,14 +30,14 @@ def webhook (request, bot_token):
30
30
#verifico la validità del token
31
31
bot = DjangoTelegramBot .getBot (bot_id = bot_token , safe = False )
32
32
if bot is None :
33
- logger .warn ('Request for not found token : {}' .format (bot_token ))
33
+ logger .warning ('Request for not found token : {}' .format (bot_token ))
34
34
return JsonResponse ({})
35
35
36
36
try :
37
37
data = json .loads (request .body .decode ("utf-8" ))
38
38
39
39
except :
40
- logger .warn ('Telegram bot <{}> receive invalid request : {}' .format (bot .username , repr (request )))
40
+ logger .warning ('Telegram bot <{}> receive invalid request : {}' .format (bot .username , repr (request )))
41
41
return JsonResponse ({})
42
42
43
43
dispatcher = DjangoTelegramBot .getDispatcher (bot_token , safe = False )
@@ -51,7 +51,7 @@ def webhook (request, bot_token):
51
51
logger .debug ('Bot <{}> : Processed update {}' .format (bot .username , update ))
52
52
# Dispatch any errors
53
53
except TelegramError as te :
54
- logger .warn ("Bot <{}> : Error was raised while processing Update." .format (bot .username ))
54
+ logger .warning ("Bot <{}> : Error was raised while processing Update." .format (bot .username ))
55
55
dispatcher .dispatchError (update , te )
56
56
57
57
# All other errors should not stop the thread, just print them
0 commit comments