All tools / Messages

File type filter builder

Build the file_types array for a file upload component or an attachment option: groups, extensions, and the 10-item cap.

Extension only

File upload components and attachment command options accept up to 10 entries. Each entry is a group name (image, video, or audio) or a dot-prefixed extension such as .pdf. Extensions are case-insensitive and stored lowercase, so .PDF and .pdf match. The check compares the filename only and does not inspect the bytes. Discord says not to hardcode the extension lists behind the groups, because those lists change.

Related: Attachment upload limit planner · Modal and text input limit checker