Files
beef/extensions/notifications/channels/pushover.rb
Jonathan Echavarria 3e34834c78 Fixed rescuing Exception
2017-10-16 11:19:32 -04:00

27 lines
695 B
Ruby

require 'rushover'
module BeEF
module Extension
module Notifications
module Channels
class Pushover
def initialize(message)
@config = BeEF::Core::Configuration.instance
# Configure the Pushover Client
client = Rushover::Client.new(@config.get('beef.extension.notifications.pushover.app_key'))
res = client.notify(@config.get('beef.extension.notifications.pushover.user_key'), message)
print_error '[Notifications] Pushover notification failed' unless res.ok?
rescue => e
print_error "[Notifications] Pushover notification initialization failed: '#{e.message}'"
end
end
end
end
end
end