Created
April 15, 2021 02:14
-
-
Save mingkyme/23fd9357d8e702e6fec7ce51bfc44cc2 to your computer and use it in GitHub Desktop.
alfred workflow에서 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
import sys | |
import requests | |
message = sys.argv[1] | |
token = "TOKEN"; | |
channel_id = "CHANNEL ID" | |
channel_url = "https://discord.com/api/v8/channels/"+channel_id+"/messages" | |
headers = { | |
'Authorization': token, | |
'Accept': '/', | |
'Authority': 'discordapp.com', | |
'content-type': 'application/json' | |
} | |
respone = requests.post(channel_url, headers=headers, data='{"content":"'+message+'"}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment