mirror of
https://github.com/discourse/discourse-chat-integration.git
synced 2025-02-10 13:34:55 +00:00
2f6d6f0d54
Provider controllers are automatically disabled when the provider is disabled (works the same way as plugin controllers)
19 lines
541 B
Ruby
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 |