Skip to content

Commit

Permalink
Merge pull request ryosan-470#32 from jtwp470/dev-char2emoji
Browse files Browse the repository at this point in the history
文字列を入れると*-man という形にして返すキモい機能をつくった  ryosan-470#31 ryosan-470#32
  • Loading branch information
ryosan-470 committed Jul 1, 2015
2 parents 6953ea8 + fb6ab34 commit 90ef33a
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 90ef33a

Please sign in to comment.