yetibot / core

:expressionless: Core yetibot utilities, extracted for shared use among Yetibot and its various plugins
https://yetibot.com
Eclipse Public License 1.0
27 stars 17 forks source link

refactor of adding user message to history table #196

Closed gkspranger closed 3 years ago

gkspranger commented 3 years ago

SIDE NOTE: this is step 1 of refactoring to (record-and-run-raw) function where newly extracted functions can be re-used -- didn't want to overwhelm tho, so breaking it up

yetibot=# \pset format csv
Output format is csv.

yetibot=# SELECT body, correlation_id FROM yetibot_history;
body,correlation_id
!help,1625587679182-1496177164
"Use `help <command>` on any of the following for more details.
Use `category` to list command by their category,  e.g. `category list fun`.
✅ Fallback commands are enabled, and the default command is `help`. This is triggered when a user enters a command that does not exist, and passes whatever the user entered as args to the fallback command.

Available commands:

`!`, `about`, `alias`, `category`, `channel`, `cmd`, `count`, `cron`, `data`, `date`, `decode`, `default`, `droplast`, `duckling`, `echo`, `error`, `eval`, `flatten`, `grep`, `head`, `help`, `history`, `join`, `karma`, `keys`, `letters`, `list`, `my`, `nil`, `obs`, `observer`, `our`, `parse`, `random`, `range`, `raw`, `react`, `render`, `repeat`, `replyto`, `rest`, `reverse`, `set`, `shuffle`, `sort`, `sortnum`, `split`, `ssh`, `status`, `sum`, `tail`, `take`, `tee`, `test`, `that`, `trim`, `unletters`, `unquote`, `unwords`, `uptime`, `url`, `users`, `vals`, `words`, `xargs`, `yeti`",1625587679182-1496177164

!echo hello,1625587687483--455860553
hello,1625587687483--455860553

!this is not a command,1625588132325-748017754
"help all # get help for all topics
help <topic> # get help for <topic>. If no exact matches are found for topic, it will fallback to the topic with the smallest Levenshtein distance < 2",1625588132325-748017754
codecov[bot] commented 3 years ago

Codecov Report

Merging #196 (1cff87f) into master (063f47a) will increase coverage by 0.67%. The diff coverage is 67.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #196      +/-   ##
==========================================
+ Coverage   56.86%   57.53%   +0.67%     
==========================================
  Files          94       94              
  Lines        4138     4145       +7     
  Branches      222      222              
==========================================
+ Hits         2353     2385      +32     
+ Misses       1563     1538      -25     
  Partials      222      222              
Impacted Files Coverage Δ
src/yetibot/core/handler.clj 36.36% <67.64%> (+22.77%) :arrow_up:
src/yetibot/core/commands/help.clj 21.05% <0.00%> (-2.64%) :arrow_down:
src/yetibot/core/util/command.clj 72.91% <0.00%> (+2.08%) :arrow_up:
src/yetibot/core/models/history.clj 90.32% <0.00%> (+6.45%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 063f47a...1cff87f. Read the comment docs.