Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
bbb856c7
Commit
bbb856c7
authored
9 years ago
by
Allen Gilliland
Browse files
Options
Downloads
Plain Diff
Merge pull request #2118 from metabase/restore-printlns-for-cam
restore printlns.
parents
cc70036a
341b5ced
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/metabot.clj
+6
-6
6 additions, 6 deletions
src/metabase/metabot.clj
with
6 additions
and
6 deletions
src/metabase/metabot.clj
+
6
−
6
View file @
bbb856c7
...
...
@@ -37,7 +37,7 @@
{(
if
(
true?
dispatch-token
)
(
keyword
symb
)
dispatch-token
)
varr
}))]
(
log/debug
(
u/format-color
'cyan
verb
)
fn-map
)
(
println
(
u/format-color
'cyan
verb
)
fn-map
)
(
fn
dispatch*
([]
(
keys-description
(
format
"Here's what I can %s:"
verb
)
fn-map
))
...
...
@@ -164,7 +164,7 @@
(
when-let
[
tokens
(
seq
(
edn/read-string
(
str
"("
(
->
s
(
str/replace
"“"
"\""
)
; replace smart quotes
(
str/replace
"”"
"\""
))
")"
)))]
(
log/debug
(
u/format-color
'magenta
tokens
))
(
println
(
u/format-color
'magenta
tokens
))
(
apply
apply-metabot-fn
tokens
))))
...
...
@@ -173,14 +173,14 @@
(
defn-
message->command-str
[{
:keys
[
text
]}]
(
u/prog1
(
when
(
seq
text
)
(
second
(
re-matches
#
"^mea?ta?boa?t\s+(.*)$"
text
)))
(
log/debug
(
u/format-color
'yellow
<>
))))
(
println
(
u/format-color
'yellow
<>
))))
(
defn-
respond-to-message!
[
message
response
]
(
when
response
(
let
[
response
(
if
(
coll?
response
)
(
str
"```\n"
(
u/pprint-to-str
response
)
"```"
)
(
str
response
))]
(
when
(
seq
response
)
(
log/debug
(
u/format-color
'green
response
))
(
println
(
u/format-color
'green
response
))
(
slack/post-chat-message!
(
:channel
message
)
response
)))))
(
defn-
handle-slack-message
[
message
]
...
...
@@ -199,14 +199,14 @@
(
defn-
handle-slack-event
[
socket
start-time
event
]
(
when-not
(
=
socket
@
websocket
)
(
log/debug
"Go home websocket, you're drunk."
)
(
println
"Go home websocket, you're drunk."
)
(
s/close!
socket
)
(
throw
(
Exception.
)))
(
when-let
[
event
(
json/parse-string
event
keyword
)]
(
when
(
and
(
human-message?
event
)
(
>
(
event-timestamp-ms
event
)
start-time
))
(
log/debug
(
u/pprint-to-str
'cyan
event
))
(
println
(
u/pprint-to-str
'cyan
event
))
(
binding
[
*channel-id*
(
:channel
event
)]
(
do-async
(
handle-slack-message
event
))))))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment