Hubotで、IRCの表示される文字を修飾する方法
LimeChatで普段文字を修飾する場合、修飾語「<bold>」(太字)などをつけて投稿します。
Hubotから表示する文章も同じように修飾方法で修飾しようとしたら出来ませんでした。
Hubotからの投稿で文字を修飾する場合、以下のようにするようです。
修飾語 | 効果 |
---|---|
\x02 | 太字 |
\x1f | 下線 |
\x16 | 反転 |
例
午前0時に時間をつぶやくcron処理。▼cron_clock.coffee
# Description: # a time signal. # # Notes: # a reference to determine the time of day cronJob = require('cron').CronJob; module.exports = (robot) -> # *(sec) *(min) *(hour) *(day) *(month) *(day of the week) new cronJob('0 0 0 * * *', () -> user = {room: '#hoge'} robot.send user, "\x02" + "- - - " + new Date + " - - -" ).start();