Skip to content

Commit

Permalink
Jihou: 起動後の応答遅延防止に設定秒数待機するようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
koi-chan committed Sep 9, 2015
1 parent f1d1f3e commit 51a0de0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/jihou.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 時報プラグインの設定
Jihou:
# 起動後、タイマーを動かさない時間(秒)。デフォルトは60秒
# チャンネルの情報などを取得するため、接続直後は発言が遅延するため
Wait: 30
# 時報を発言する時間とチャンネル
Timer:
'00:00:00':
Expand Down
7 changes: 7 additions & 0 deletions lib/rgrb/plugin/jihou/irc_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ def initialize(*args)

config_data = config[:plugin] || {}
@timer = config_data['Timer']
@wait = config_data['Wait'] || 60

Timer(0, {shots: 1, method: :wait}).start
# Timer(1, method: :jihou).start
end

def wait
sleep(@wait)
Timer(1, method: :jihou).start
end

Expand Down

0 comments on commit 51a0de0

Please sign in to comment.