discourse/lib/onebox/engine/twitch_stream_onebox.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
324 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require_relative '../mixins/twitch_onebox'
class Onebox::Engine::TwitchStreamOnebox
def self.twitch_regexp
/^https?:\/\/(?:www\.|go\.)?twitch\.tv\/(?!directory)([a-zA-Z0-9_]{4,25})$/
end
include Onebox::Mixins::TwitchOnebox
def query_params
"channel=#{twitch_id}"
end
end