Feature request: Ability to add snippets
Once a block of text exceeds 3978 characters it can't be fit into a single message and needs to be made into a snippet. Request to add ability to create snippets using a piped in block of text in the CLI.
I'd like to work on this if you don't mind. Would be a fun first foray into python.
Sounds good! Creating a snippet is pretty much like uploading a file, except that you need to call the upload API method with a content parameter instead of a file: https://api.slack.com/methods/files.upload
As for the CLI argument, maybe we can use the -F/--snippet? What do you think?
I like the --snippet, but I'm not sure what the idea was on the -F. With Christmas over I will finally have some time to try this.
take your time :)
I'm not sure what the idea was on the -F
It's just that most options can be specified in two forms: short and long. For instance: -f and --file both work for uploading a file.
ah okay. Too bad -s is already taken. Maybe -C for code? Not really consistent with Slack though because code is just text inside triple ticks
Well, a snippet is a kind of file, and file is -f/--file, so I think -F/--snippet makes sense. Or just --snippet (no short form).
I would love this but please do have a short form. Also, if possible, allow us to specify what syntax highlighting to use.
Apparently it's possible to specify a filetype parameter. But @genebean do you often upload a file with an extension that differs from its true nature? For instance, pretty much all python files have a .py extension.