diff --git a/edmond/plugins/misc_reactions.py b/edmond/plugins/misc_reactions.py index fe92a39..c893c12 100644 --- a/edmond/plugins/misc_reactions.py +++ b/edmond/plugins/misc_reactions.py @@ -54,6 +54,11 @@ class MiscReactionsPlugin(Plugin): continue reactions.append(getattr(self, f"react_with_{reaction}")) weights.append(weight) + # Normalize weights. + total_weight = sum(weights) + weights = list(map(lambda w: w / total_weight, weights)) + self.bot.log_d(f"Reactions: {reactions}") + self.bot.log_d(f"Reaction weights: {weights}") return reactions, weights def on_pubmsg(self, event):