Skip to content

Commit

Permalink
Add beach sand embargo
Browse files Browse the repository at this point in the history
  • Loading branch information
hectron committed Jul 21, 2021
1 parent fc208a5 commit 1715388
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@
end
end

ChannelIdsWithActiveBeaches = Set.new([])

bot.command(
:beach,
help_available: true,
description: "Primes the sands for temporary messaging.",
usage: "React to the first message the bot posted with :ocean: to cause a deluge",
) do |event|
unless ChannelIdsWithActiveBeaches.add?(event.channel.id)
next "There is a current beach session in progress. This will be ignored until then."
end

msg = event.respond "The waves subside. For a brief moment, you can write in sand before then next tide. When you are done, react to the bot message with :ocean:."
done_emoji = "\u{1f30a}"

Expand All @@ -73,6 +79,8 @@
LOGGER.error(e)
end

ChannelIdsWithActiveBeaches.delete?(msg.channel.id)

reaction_event.respond "The tides roll in, and the sand begins to smooth out."
end

Expand Down

0 comments on commit 1715388

Please sign in to comment.