Skip to content

Commit

Permalink
Invite: JOIN 時のメッセージを配列形式による複数行対応に変更
Browse files Browse the repository at this point in the history
  • Loading branch information
koi-chan committed Aug 10, 2015
1 parent 2baaca7 commit 47f2876
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/rgrb/plugin/invite/irc_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ def initialize(*args)

config_data = config[:plugin] || {}
@join_message =
config_data['JoinMessage'] || 'ご招待いただきありがとう'
config_data['JoinMessage'] || [ 'ご招待いただきありがとう' ]
end

# 自分が INVITE されたら自動的にそのチャンネルに入る
# @param [Cinch::Message] m 送信されたメッセージ
# @return [void]
def invite(m)
Channel(m.channel).join
@join_message.each_line do |line|
message = line.chomp
@join_message.each do |message|
m.target.send(message, true)
log("<JOIN on #{m.channel}> #{message}", :outgoing, :info)
end
Expand Down

0 comments on commit 47f2876

Please sign in to comment.