Skip to content

Commit

Permalink
Use politically accepted variables for the Western spy
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristgit committed Jul 25, 2024
1 parent f09dac0 commit edfd814
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/ff_bot/encouragement.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ defmodule FFBot.Encouragement do
Encouragement functions for our Comrades.
"""

@german_reunification_margin 0.01
@cuban_missile_crisis_threshold 0.01
# Fractional percentage of how often the bot will generate a supportive
# comment on merge.
@support_a_comrade_margin 0.01
# Fractional percentage of how often the bot will generate an encouraging
# comment on conflicts.
@encourage_a_comrade_threshold 0.01

defp supports_comrades? do
Application.get_env(:ff_bot, :disable_propaganda?) == nil
end

defp should_generate_supportive_comment? do
:rand.uniform() < @german_reunification_margin
:rand.uniform() < @support_a_comrade_margin
end

defp should_generate_encouraging_comment? do
:rand.uniform() < @cuban_missile_crisis_threshold
:rand.uniform() < @encourage_a_comrade_threshold
end

@doc """
Expand Down

0 comments on commit edfd814

Please sign in to comment.