Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

Commit

Permalink
文字列を入れると*-man という形にして返すキモい機能をつくった
Browse files Browse the repository at this point in the history
  • Loading branch information
ryosan-470 committed Jul 7, 2015
1 parent 90f9a6e commit 00bb86c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/misc.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Description:
# misc.coffee
# なんか書いたけどほんとに必要なのかわからない謎機能をまとめる
#
# Commands:
# :c2e / man - 入力文字から :*-man: という形の文字列を返す
module.exports = (robot) ->
robot.hear /c2e ([A-Za-z ]+$)/, (msg) -> # 大文字小文字のアルファベットを受理
result = ""
for r in msg.match[1].toLowerCase() # すべての文字を小文字に変換
if r == " "
result += " "
else
result += ":" + r + "-man:"
msg.send result

0 comments on commit 00bb86c

Please sign in to comment.