Debian Codegraph @

docpages/example_programs/interactions_and_components/slashcommands/upload_parameter.md

raw
1 \page discord-application-command-file-upload Using File Parameters for Application Commands (Slash Commands)
2
3 The program below demonstrates how to use the 'file' type parameter to an application command (slash command).
4 You must first get the `file_id` via `std::get`, and then you can find the attachment details in the 'resolved'
5 section, `event.command.resolved`.
6
7 The file is uploaded to Discord's CDN so if you need it locally you should fetch the `.url` value, e.g. by using
8 something like dpp::cluster::request().
9
10 \include{cpp} upload_parameter.cpp