mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-18 01:14:53 +00:00
This adds support for the a Discord bot that can search in a Discourse instance when invoked via slash commands in Discord Guild channel.
18 lines
443 B
Ruby
18 lines
443 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class StreamDiscordReply < ::Jobs::Base
|
|
sidekiq_options retry: false
|
|
|
|
def execute(args)
|
|
interaction = args[:interaction]
|
|
|
|
if SiteSetting.ai_discord_search_mode == "persona"
|
|
DiscourseAi::Discord::Bot::PersonaReplier.new(interaction).handle_interaction!
|
|
else
|
|
DiscourseAi::Discord::Bot::Search.new(interaction).handle_interaction!
|
|
end
|
|
end
|
|
end
|
|
end
|