only trigger updating clan messages in updated directories.
Update clan info message if the template was updated.
This commit is contained in:
@@ -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}")
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user