only trigger updating clan messages in updated directories.

Update clan info message if the template was updated.
This commit is contained in:
2024-05-16 21:37:10 -04:00
parent 3761d3bb77
commit 04c44bc470
2 changed files with 29 additions and 5 deletions
+3 -2
View File
@@ -4,6 +4,7 @@ File contains util functions.
import os
from datetime import datetime
from typing import Iterable
import nextcord
from sqlalchemy import select, true, update
@@ -395,7 +396,7 @@ def record_event_host(config: DakinyConfig, user: int):
session.commit()
async def update_clan_messages(guild: nextcord.Guild):
async def update_clan_messages(guild: nextcord.Guild, channel_updates: Iterable[str]):
"""
Updates all clan messages to contents in MESSAGES_DIR.
Does not to any git work. Is expected to be called after git is pulled.
@@ -411,7 +412,7 @@ async def update_clan_messages(guild: nextcord.Guild):
dirs = [
dir_name
for dir_name in os.listdir(MESSAGES_DIR)
for dir_name in channel_updates
if os.path.isdir(f"{MESSAGES_DIR}/{dir_name}")
]