Ruboty | チャットを空メッセージ or 任意のメッセージで埋める ruboty-ume を作成しました #ruboty
概要
チャットを空メッセージ or 任意のメッセージで埋める ruboty-ume を作成しました。
用途
ruboty google_image で妙な画像を引き当ててしまった。
そんなときに限って、偉い人が近づいてくる。
急いでチャット画面から画像を追い出すんだ。
内緒のメッセージのやりとり。
そんなときに限って、内緒のやりとりがばれるとまずい相手が近づいてくる。
急いでチャット画面から画像を追い出すんだ。
そんな時に空行を大量に追加してメッセージを画面外に追い出します。
仕様
ume
key | value |
---|---|
pattern | /ume (?<count>.*?)\z/ |
description | output empty message N lines (<count> times). default count = 15. |
name | ume |
umec
key | value |
---|---|
pattern | /umec (?<text>.+?) (?<count>.*?)\z/ |
description | output <text> message N lines (<count> times). default count = 15. |
name | umec |
利用法
- Gemfile
source 'https://rubygems.org'
gem 'ruboty-ume'
- 実行
$ bundle install
$ bundle exec ruboty
> ruboty help
ruboty /ume (?<count>.*?)\z/ - output empty message N lines (<count> times)
ruboty /umec (?<text>.+?) (?<count>.*?)\z/ - output <text> message N lines (<count> times)
ruboty /help( me)?\z/i - Show this help message
ruboty /ping\z/i - Return PONG to PING
ruboty /who am i\?/i - Answer who you are
> ruboty ume 3
> ruboty ume 5
> ruboty umec hoge 3
hoge
hoge
hoge
> ruboty umec hoge 5
hoge
hoge
hoge
hoge
hoge
補足
- 実装時に Ruboty のテンプレートジェネレータ ruboty-gen を利用しています。
- テストコードのひな形生成に rspec_piccolo を利用しています。
参照
ruboty-ume GitHub
ruboty-ume RubyGems
ume GitHub
ume RubyGems
rspec_piccolo GitHub
rspec_piccolo RubyGems
Ruboty GitHub
Ruboty RubyGems
ruboty-gen GitHub
ruboty-gen RubyGems
Ruboty | 自作 Handler gem の作成