Created
April 14, 2021 15:48
-
-
Save mingkyme/bf96a942901f0695cf4f9ab36031edf3 to your computer and use it in GitHub Desktop.
Discord에 메시지를 전송합니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message = "Hi!"; | |
token = "TOKEN"; | |
channel_id = "CHANNEL ID"; | |
channel_url = `https://discordapp.com/api/v6/channels/${channel_id}/messages` | |
request = new XMLHttpRequest(); | |
request.withCredentials = true; | |
request.open("POST", channel_url); | |
request.setRequestHeader("authorization", token); | |
request.setRequestHeader("accept", "/"); | |
request.setRequestHeader("authority", "discordapp.com"); | |
request.setRequestHeader("content-type", "application/json"); | |
request.send(JSON.stringify({ content: message })); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment