David Taylor 2f6d6f0d54 Automatically mount provider’s engines at /chat-integration/{provider_name}
Provider controllers are automatically disabled when the provider is disabled (works the same way as plugin controllers)
2017-07-05 15:03:02 +01:00

19 lines
541 B
Ruby

module DiscourseChat::Provider::TelegramProvider
class TelegramCommandController < DiscourseChat::Provider::HookController
requires_provider ::DiscourseChat::Provider::TelegramProvider::PROVIDER_NAME
def say_hello
render json: {hello: "from telegram"}
end
end
class TelegramEngine < ::Rails::Engine
engine_name DiscourseChat::PLUGIN_NAME+"-telegram"
isolate_namespace DiscourseChat::Provider::TelegramProvider
end
TelegramEngine.routes.draw do
get "command" => "telegram_command#say_hello"
end
end