Closed Srules closed 4 years ago
Hm interesting. Does your config URL have https
in the URL? I'll be able to check this out more tomorrow!
Hm interesting. Does your config URL have
https
in the URL? I'll be able to check this out more tomorrow!
Yeah.
Discord::Notifier.setup do |config| config.url = 'https://discordapp.com/api/webhooks/....
Thanks, Ian. I very much appreciate your work and response. Kind regards -Nicholas
Can you post an example script for the failure? I'm not seeing it on Ruby 2.7.1 with an embed -
Discord::Notifier.setup do |config|
config.url = 'WEBHOOK'
config.username = 'Discord Notifier Gem Local Test'
end
embed = Discord::Embed.new do
title "Discord Ruby Notification"
description "Will it work?"
end
Discord::Notifier.message(embed)
I'm on MacOS. Installing Ruby 2.5.1 right now to try that
Hm, works for me with an embed and text message
2.5.1 :001 > embed = Discord::Embed.new do
2.5.1 :002 > title "Discord Ruby Notification"
2.5.1 :003?> description "Will it work?"
2.5.1 :004?> end
=> #<Discord::Embed:0x00007fddc51b0ee0 @data={:title=>"Discord Ruby Notification", :description=>"Will it work?"}>
2.5.1 :005 > Discord::Notifier.message(embed)
=> #<Net::HTTPBadRequest 400 BAD REQUEST readbody=true>
It has to be some kind of namespace conflict with another dependency of mine. Feel free to close this issue and I'll come back if I find any serious concern with a major dependency.
Worked for me in a fresh project. Apologies for bubbling this up so soon. Thanks for your time Ian.
No worries at all! Very curious what's going on still... Are you on the latest version of the gem in your project?
It is actually 1.0.2 and not 1.0.3. Let me try the update.
Really hoping this is #11 again in a slightly different form :D
I think actually that did fix it. 💯
Awesome! I'll go ahead and close this then, glad things are working 😄
I believe the Net::HTTP is rejecting requests to https endpoints without setting the
http.use_ssl = true
flag on your post. I was able to resolve my issue with the following update:https://github.com/Confidist/discord-notifier/commit/55d364f2ba75a7f330a7777c639f92ceb591947c
I am using ruby 2.5.1 https://ruby-doc.org/stdlib-2.5.1/libdoc/net/http/rdoc/Net/HTTP.html
I am curious if others are running into this same issue. Ian can you confirm?