diff --git a/__init__.py b/__init__.py index 8b64cfe..41b4b6d 100644 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,5 @@ from dotenv import dotenv_values +from collections import defaultdict # from bot.handlers.MainChannelHandler import MainChannelHandler # from bot.handlers.TestChannelHandler import TestChannelHandler # from bot.handlers.TestChannelPhotoHandler import TestChannelPhotoHandler @@ -51,3 +52,12 @@ video_msg_handlers = [ # MainChannelVideoHandler(), # # CopyFromMainChannelVideoHandler() ] + +def recursive_dict_merge(dict1, dict2): + result = defaultdict(list) + for d in [dict1, dict2]: + for key, value in d.items(): + result[key].extend(value) + result = dict(result) + + return result