Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Team.active.asc(:_id).each do |team|
begin
next if team.premium
STDOUT.write "#{team.name}: "
client = Slack::Web::Client.new(token: team.token)
channels = client.channels_list['channels'].select { |channel| channel['is_member'] }
channels.each do |channel|
STDOUT.write "#{channel['name']} "
client.chat_postMessage(
channel: channel.id,
as_user: true,
text: "With 300+ active teams, PlayPlay.io can no longer operate entirely for free and is going freemium for some features, including seasons and turning GIFs off. #{team.upgrade_text} We appreciate your support!"
)
end
STDOUT.write "\n"
rescue Exception => e
puts "#{team.id} ERROR: #{e.message}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment