This commit is contained in:
@@ -43,12 +43,13 @@ class Config:
|
||||
return default_replies
|
||||
|
||||
def _load_ads(self, file_path: str = "storage/ads.txt"):
|
||||
"""Load ad content from file (single ad, no multi-line conversion needed)"""
|
||||
"""Load ad content from file (can be multi-line with actual line breaks or \\n)"""
|
||||
try:
|
||||
with open(file_path, "r", encoding="utf-8") as f:
|
||||
ad_content = f.read().strip()
|
||||
if ad_content:
|
||||
return ad_content
|
||||
# Convert literal \n to actual newlines for ads too
|
||||
return ad_content.replace("\\n", "\n")
|
||||
return None
|
||||
except FileNotFoundError:
|
||||
logger.warning(f"Ad file {file_path} not found")
|
||||
|
||||
Reference in New Issue
Block a user