Skip to content

tbpgr/ruboty-brain_dictionary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruboty::BrainDictionary

A Ruboty Handler + Actions to learn your key-value into brain.

Gem Version

Ruboty is Chat bot framework. Ruby + Bot = Ruboty

⬇️ Installation

Add this line to your application's Gemfile:

gem 'ruboty-brain_dictionary'

And then execute:

$ bundle

🆑 Commands

Command Pattern Description
learn /learn\s{1}?(?<key>.+)?\s{1}(?<value>.+)?\z/ learn key-value
remember /remember\s{0,1}?(?<key>.+)?\z/ remember your ruboty brain_dictionary that match your keys.
dict /dict\s{1}?(?<key>.+)?\z/ show your value from brain.
forget /forget\s{0,1}?(?<key>.+)?\z/ forget your ruboty brain_dictionary that match your key.

📜 Usage

learn

  • learn key-value
>ruboty learn tu ka
>ruboty remember tu
tu,ka

remember

  • remember your ruboty brain_dictionary that match with your keys.
>ruboty learn hoge hoge-value
>ruboty learn hige hige-value
>ruboty learn hage hage-value
>ruboty learn hoo bar

# remember all
>ruboty remember
hage,hage-value
hige,hige-value
hoge,hoge-value
hoo,bar

# remember match keys
>ruboty remember ge
hage,hage-value
hige,hige-value
hoge,hoge-value

# remember match key
>ruboty remember hoo
hoo,bar

dict

>ruboty learn hoge hoge-value
>ruboty learn hige hige-value
>ruboty learn hage hage-value
>ruboty learn hoo bar
>dict hoge
hoge-value
>dict hoo
hoo-value
>dict hogea
>

forget

  • forget your ruboty brain_dictionary that match with your key.
>ruboty learn hoge hoge-value
>ruboty learn hige hige-value
>ruboty learn hage hage-value
>ruboty learn hoo bar

# remember all
>ruboty remember
hage,hage-value
hige,hige-value
hoge,hoge-value
hoo,bar

# forget hoo & confirm
>ruboty forget hoo
success delete key 'hoo'

>ruboty remember
hage,hage-value
hige,hige-value
hoge,hoge-value

# forget hoo ( not exist )
>ruboty forget hoo
no key 'hoo'

🌏 ENV

Name Description
-- --

👫 Dependency

Name Description
-- --

👬 Contributing 👭

  1. Fork it ( https://github.com/tbpgr/ruboty-brain_dictionary/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages