Commit c226c00 1 parent 85fa6a9 commit c226c00 Copy full SHA for c226c00
File tree 3 files changed +12
-3
lines changed
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 19
19
20
20
- name : Install dependencies
21
21
run : |
22
+ python -m pip install types-PyYAML types-requests
22
23
python -m pip install --upgrade pip
23
24
python -m pip install pre-commit
24
25
pre-commit install-hooks
Original file line number Diff line number Diff line change 3
3
import requests
4
4
5
5
from datetime import datetime , timedelta
6
+ from typing import Dict , Any
6
7
7
8
# Rutas a los archivos de configuración
8
9
CONFIG_PATH = "data/config.yaml"
15
16
domain_percentage_table = {}
16
17
all_users_configurations : dict [str , dict ] = {}
17
18
18
- config_data = {
19
+ config_data : Dict [ str , Any ] = {
19
20
# Telegram
20
21
"BOT_TOKEN" : "" ,
21
22
"DELETE_MESSAGES" : "" ,
Original file line number Diff line number Diff line change 1
1
from handlers .base_handler import PATTERN_URL_QUERY
2
- from typing import Dict , Optional
2
+ from typing import Dict
3
3
4
- PATTERNS : Dict [str , Dict [str , Optional [str ]]] = {
4
+ from typing import TypedDict
5
+
6
+ class PatternConfig (TypedDict ):
7
+ pattern : str
8
+ format_template : str
9
+ affiliate_tag : str
10
+
11
+ PATTERNS : Dict [str , PatternConfig ] = {
5
12
"amazon" : {
6
13
"pattern" : (
7
14
r"(https?://(?:www\.)?(?:amazon\.[a-z]{2,3}(?:\.[a-z]{2})?|amzn\.to|amzn\.eu)"
You can’t perform that action at this time.
0 commit comments