Skip to content

Commit 909bed1

Browse files
committed
New way of posting to slack via bot app.
1 parent 291ed6f commit 909bed1

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

app/controllers/games_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ def show
2525
def say
2626
text = params[:text]
2727
game_id = params[:game_id]
28-
gandhi_url = "https://vignette.wikia.nocookie.net/civilization/images/3/36/Gandhi_%28Civ5%29.png/revision/latest?cb=20121104232443"
2928
game = ReadModel::GameReadModel.find_by(id: game_id)
3029
client = Slack::Web::Client.new(token: game.slack_token)
3130
begin
32-
client.chat_postMessage(channel: game.slack_channel, text: text, as_user: false, icon_url: gandhi_url)
31+
client.chat_postMessage(channel: game.slack_channel, text: text)
3332
rescue => e
3433
puts(e.inspect)
3534
end

notifications/lib/notifications/slack_notifier.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ def new_turn_notification(event)
2727
client.chat_postMessage(
2828
channel: game.slack_channel,
2929
text: game.build_slack_new_turn_message(event.data),
30-
as_user: false,
31-
icon_url: gandhi_url
3230
)
3331
end
3432

@@ -44,17 +42,11 @@ def maybe_notify_remaining_players(event)
4442
client.chat_postMessage(
4543
channel: game.slack_channel,
4644
text: "Turn " + remaining_players_mentions,
47-
as_user: false,
48-
icon_url: gandhi_url
4945
)
5046
logger.warn("Slack response: #{response.pretty_inspect}") if logger
5147
end
5248
end
5349

54-
def gandhi_url
55-
"https://vignette.wikia.nocookie.net/civilization/images/3/36/Gandhi_%28Civ5%29.png/revision/latest?cb=20121104232443"
56-
end
57-
5850
attr_reader :logger, :event_store
5951
end
6052
end

0 commit comments

Comments
 (0)