Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
previndexinfo

code guessing, round #74, stage 1 (writing)

started at . submit by

specification

sorry I'm late, I overslept. uh, please send a song in discord. submissions may be written in languages with support for networking.

the API endpoint Create Message (POST https://discord.com/api/v10/channels/{channel.id}/messages) allows bot accounts to send messages on Discord. you'll need these headers for your request to go through:

User-Agent: DiscordBot (https://github.com/ClientLibraryMakers/MyClientLibrary, 1.0.0)
Content-Type: application/json
Authorization: Bot MTk4NjIyNDgzNDcxOTI1MjQ4.Cl2FMQ.ZnCjm1XVW7vRze4b7Cq4se7kKWs

you can use the content field in the body to include a link to a song ({"content": "https://soundcloud.com/100gecs/757a1"}). if you would like to send it as an attachment, the request should be a multipart/form-data request including a files[0] file:

...
Content-Type: multipart/form-data; boundary=mjauuuu

--mjauuuu
Content-Disposition: form-data; name="content"

here is your song I made it for you
--mjauuuu
Content-Disposition: form-data; name="files[0]"; filename="yoursong.ogg"
Content-Type: audio/ogg

[audio bytes]
--mjauuuu--

if you like, you can send the rest of the request as ordinary JSON while doing this using a key named payload_json:

...
Content-Type: multipart/form-data; boundary=mjauuuu

--mjauuuu
Content-Disposition: form-data; name="payload_json"
Content-Type: application/json

{
  "embeds": [{
    "title": "wow!",
    "description": "look at this song I made for you :heart:"
  }]
}
--mjauuuu
Content-Disposition: form-data; name="files[0]"; filename="yoursong.ogg"
Content-Type: audio/ogg

[audio bytes]
--mjauuuu--

your challenge, given a bot token and the ID of a channel it can send to, is to send a song to that channel. as most languages are allowed, and the prompt is somewhat open-ended, there is no fixed API.

entries

0 entries have been received so far.

submit