Fix channel heating (level 0 channel name)
This commit is contained in:
@@ -81,8 +81,9 @@ class FlanaDiscBot(DiscordBot, FlanaBot):
|
|||||||
if channel.members:
|
if channel.members:
|
||||||
heating_context.heat_level += 0.5
|
heating_context.heat_level += 0.5
|
||||||
else:
|
else:
|
||||||
if not heating_context.heat_level:
|
if heating_context.heat_level == -1:
|
||||||
return
|
return
|
||||||
|
|
||||||
heating_context.heat_level -= 0.5
|
heating_context.heat_level -= 0.5
|
||||||
if heating_context.heat_level > len(constants.DISCORD_HEAT_NAMES) - 1:
|
if heating_context.heat_level > len(constants.DISCORD_HEAT_NAMES) - 1:
|
||||||
heating_context.heat_level = float(int(heating_context.heat_level))
|
heating_context.heat_level = float(int(heating_context.heat_level))
|
||||||
@@ -91,7 +92,7 @@ class FlanaDiscBot(DiscordBot, FlanaBot):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
i = int(heating_context.heat_level)
|
i = int(heating_context.heat_level)
|
||||||
if not i:
|
if i == -1:
|
||||||
n_fires = 0
|
n_fires = 0
|
||||||
new_name = channels_data['C'].original_name
|
new_name = channels_data['C'].original_name
|
||||||
elif i < len(constants.DISCORD_HEAT_NAMES):
|
elif i < len(constants.DISCORD_HEAT_NAMES):
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ class ChannelData:
|
|||||||
class HeatingContext:
|
class HeatingContext:
|
||||||
channels_data: dict[str, ChannelData] = field(default_factory=dict)
|
channels_data: dict[str, ChannelData] = field(default_factory=dict)
|
||||||
is_active: bool = False
|
is_active: bool = False
|
||||||
heat_level: float = 0.0
|
heat_level: float = -1
|
||||||
|
|||||||
Reference in New Issue
Block a user