Closed kreativmonkey closed 3 years ago
Scheinbar ist flask das mittel der wahl... https://forum.uipath.com/t/creating-a-simple-webhook-listener-using-python/235217 schaut recht simpel aus.
Beispiel der umsetzung: https://stackoverflow.com/questions/48693069/running-flask-a-discord-bot-in-the-same-application
Secret Verification example: https://meta.discourse.org/t/discourse-signing-parameters-in-webhooks/134415
Code im Discourse:
def payload(secret = nil)
payload = Base64.strict_encode64(unsigned_payload)
"sso=#{CGI::escape(payload)}&sig=#{sign(payload, secret)}"
end
if @web_hook.secret.present?
headers['X-Discourse-Event-Signature'] = "sha256=#{OpenSSL::HMAC.hexdigest("sha256", @web_hook.secret, web_hook_body)}"
end
https://hackaday.com/2018/02/15/creating-a-discord-webhook-in-python/