You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config.sample.yml
+19-14Lines changed: 19 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -42,23 +42,28 @@ media:
42
42
# Omit or keep empty to disable limit
43
43
max_size: 10M
44
44
45
-
# Optionally specify configuration per media type
46
-
types:
47
-
# Configuration for media files of type "photo"
48
-
photo:
49
-
# Choose whether to download photos
50
-
enabled: true
51
-
52
-
# Set max size for photos
45
+
# Configure rules to define whether to download media for specific media types, chat types and/or contacts
46
+
# If there is at least one rule, downloading will be disabled by default until a matching configuration is found
47
+
# The first matching rule will be used
48
+
# You might also specify "download_path", "max_size" and "file_pattern" in a rule to change them for a specific rule.
49
+
rules:
50
+
51
+
# This rule will enable downloads of photos up to 10 MB for specific contacts
52
+
- media_type: photo
53
+
chat_type: contact
54
+
chats:
55
+
- <id 1>
56
+
- <id 2>
57
+
- ...
53
58
max_size: 10M
54
59
55
-
#Configuration for media files of type "file" (i.e. everything else)
56
-
file:
57
-
# Choose whether to download files
58
-
enabled: true
60
+
#This rule will allow any media download regardless of the media type but limit it to 50 MB per media download and put the files in "/downloads/channels"
61
+
- chat_type: channel
62
+
max_size: 50M
63
+
download_path: /downloads/channels
59
64
60
-
# Set max size for files
61
-
max_size: 10M
65
+
# This rule will accept any media download with a maximum size of 5 MB
logging.debug("Skipping message {} from chat '{}' as chat type {} is not enabled".format(message.id, chat_display_name, chat_type.valueifchat_typeelseNone))
0 commit comments