FIX: Allow slash commands to set rules in private groups
The Slack 'slash commands' API does not provide the user-friendly group name, so we must use the group ID. We could use the API to obtain the group name, but it would require adding additional scopes to the app.
This commit is contained in:
parent
154361e22c
commit
7e5dc5acc1
|
@ -28,6 +28,8 @@ module DiscourseChat::Provider::SlackProvider
|
|||
case params[:channel_name]
|
||||
when 'directmessage'
|
||||
"@#{params[:user_name]}"
|
||||
when 'privategroup'
|
||||
params[:channel_id]
|
||||
else
|
||||
"##{params[:channel_name]}"
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ module DiscourseChat::Provider::SlackProvider
|
|||
PROVIDER_ENABLED_SETTING = :chat_integration_slack_enabled
|
||||
|
||||
CHANNEL_PARAMETERS = [
|
||||
{ key: "identifier", regex: '^[@#]\S*$', unique: true }
|
||||
{ key: "identifier", regex: '^[@#]?\S*$', unique: true }
|
||||
]
|
||||
|
||||
def self.excerpt(post, max_length = SiteSetting.chat_integration_slack_excerpt_length)
|
||||
|
|
Loading…
Reference in New Issue