Fix channel heating (level 0 channel name)

This commit is contained in:
AlberLC
2024-05-26 09:07:00 +02:00
parent 07ab104203
commit df72d752c1
2 changed files with 4 additions and 3 deletions

View File

@@ -81,8 +81,9 @@ class FlanaDiscBot(DiscordBot, FlanaBot):
if channel.members:
heating_context.heat_level += 0.5
else:
if not heating_context.heat_level:
if heating_context.heat_level == -1:
return
heating_context.heat_level -= 0.5
if heating_context.heat_level > len(constants.DISCORD_HEAT_NAMES) - 1:
heating_context.heat_level = float(int(heating_context.heat_level))
@@ -91,7 +92,7 @@ class FlanaDiscBot(DiscordBot, FlanaBot):
continue
i = int(heating_context.heat_level)
if not i:
if i == -1:
n_fires = 0
new_name = channels_data['C'].original_name
elif i < len(constants.DISCORD_HEAT_NAMES):

View File

@@ -16,4 +16,4 @@ class ChannelData:
class HeatingContext:
channels_data: dict[str, ChannelData] = field(default_factory=dict)
is_active: bool = False
heat_level: float = 0.0
heat_level: float = -1