Skip to content

Commit

Permalink
Merge pull request #2363 from coder2020official/middlewares
Browse files Browse the repository at this point in the history
Revert changes to middlewares
  • Loading branch information
Badiboy authored Aug 11, 2024
2 parents 21e92fb + c79e63e commit 42bef47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions telebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# random module to generate random string
import random
import string
import copy

import ssl

Expand Down Expand Up @@ -8865,7 +8864,7 @@ def _run_middlewares_and_handler(self, message, handlers, middlewares, update_ty
logger.error("It is not allowed to pass data and values inside data to the handler. Check your handler: {}".format(handler['function']))
return
else:
data_copy = copy.deepcopy(data)
data_copy = data.copy()
for key in list(data_copy):
# remove data from data_copy if handler does not accept it
if key not in params:
Expand Down
4 changes: 2 additions & 2 deletions telebot/async_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import string
import random
import ssl
import copy


"""
Module : telebot
Expand Down Expand Up @@ -570,7 +570,7 @@ async def _run_middlewares_and_handlers(self, message, handlers, middlewares, up
logger.error("It is not allowed to pass data and values inside data to the handler. Check your handler: {}".format(handler['function']))
return
else:
data_copy = copy.deepcopy(data)
data_copy = data.copy()
for key in list(data_copy):
# remove data from data_copy if handler does not accept it
if key not in params:
Expand Down

0 comments on commit 42bef47

Please sign in to comment.