Module: Elephrame::Streaming
- Included in:
- Bots::Command, Bots::GenerativeBot, Bots::Interact, Bots::PeriodInteract, Bots::Reply, Bots::TraceryBot, Bots::Watcher
- Defined in:
- lib/elephrame/streaming/streaming.rb
Instance Attribute Summary collapse
-
#streamer ⇒ Object
readonly
Returns the value of attribute streamer.
Instance Method Summary collapse
-
#setup_streaming ⇒ Object
Creates the stream client.
Instance Attribute Details
#streamer ⇒ Object (readonly)
Returns the value of attribute streamer.
8 9 10 |
# File 'lib/elephrame/streaming/streaming.rb', line 8 def streamer @streamer end |
Instance Method Details
#setup_streaming ⇒ Object
Creates the stream client
13 14 15 16 17 18 19 |
# File 'lib/elephrame/streaming/streaming.rb', line 13 def setup_streaming stream_uri = @client.instance .attributes['urls']['streaming_api'] .gsub(/^wss?/, 'https') @streamer = Mastodon::Streaming::Client.new(base_url: stream_uri, bearer_token: ENV['TOKEN']) end |