Fix channel heating (level 0 channel name)

This commit is contained in:
AlberLC
2024-06-26 10:18:42 +02:00
parent 4f4a05f0ff
commit 778500caac
2 changed files with 4 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ 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 heating_context.heat_level == -1: if heating_context.heat_level == constants.HEAT_FIRST_LEVEL:
return return
heating_context.heat_level -= 0.5 heating_context.heat_level -= 0.5
@@ -92,7 +92,7 @@ class FlanaDiscBot(DiscordBot, FlanaBot):
continue continue
i = int(heating_context.heat_level) i = int(heating_context.heat_level)
if i == -1: if i == constants.HEAT_FIRST_LEVEL:
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):
@@ -219,4 +219,4 @@ class FlanaDiscBot(DiscordBot, FlanaBot):
await channel_data.channel.edit(name=channel_data.original_name) await channel_data.channel.edit(name=channel_data.original_name)
channel_data.n_fires = 0 channel_data.n_fires = 0
heating_context.heat_level = 0.0 heating_context.heat_level = constants.HEAT_FIRST_LEVEL

View File

@@ -13,6 +13,7 @@ CONNECT_4_N_COLUMNS = 7
CONNECT_4_N_ROWS = 6 CONNECT_4_N_ROWS = 6
FLOOD_2s_LIMIT = 2 FLOOD_2s_LIMIT = 2
FLOOD_7s_LIMIT = 4 FLOOD_7s_LIMIT = 4
HEAT_FIRST_LEVEL = -1
HEAT_PERIOD_SECONDS = datetime.timedelta(minutes=15).total_seconds() HEAT_PERIOD_SECONDS = datetime.timedelta(minutes=15).total_seconds()
HELP_MINUTES_LIMIT = 1 HELP_MINUTES_LIMIT = 1
INSTAGRAM_BAN_SLEEP = datetime.timedelta(days=1) INSTAGRAM_BAN_SLEEP = datetime.timedelta(days=1)