Tweak wording

This commit is contained in:
Firepup Sixfifty 2024-06-05 12:52:56 -05:00
parent b2a4e34148
commit 0c34cfc843
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA

View file

@ -15,7 +15,7 @@ load_dotenv()
for requiredVar in ["SLACK_BOT_TOKEN", "SLACK_APP_TOKEN"]: for requiredVar in ["SLACK_BOT_TOKEN", "SLACK_APP_TOKEN"]:
if not os.environ.get(requiredVar): if not os.environ.get(requiredVar):
raise ValueError( raise ValueError(
f'Missing required environment variable "{requiredVar}". Please create a .env file in the same directory as this script and define it.' f'Missing required environment variable "{requiredVar}". Please create a .env file in the same directory as this script and define the missing variable.'
) )
print("Establishing a connection to slack...") print("Establishing a connection to slack...")
@ -25,6 +25,7 @@ client = app.client
userMappings = {} userMappings = {}
try: try:
if "--no-cache" in sys.argv: if "--no-cache" in sys.argv:
print("Skipping cache on user request")
raise ImportError("User requested to skip cache") raise ImportError("User requested to skip cache")
print("Trying to load user mappings from cache...") print("Trying to load user mappings from cache...")
from cache import userMappings from cache import userMappings
@ -45,7 +46,6 @@ except ImportError:
print(f"Pages of users loaded: {pages}") print(f"Pages of users loaded: {pages}")
del pages del pages
print("Building user mappings now, this shouldn't take long...") print("Building user mappings now, this shouldn't take long...")
userMappings = {}
for user in users_list: for user in users_list:
userMappings[f"<@{user['id']}>"] = ( userMappings[f"<@{user['id']}>"] = (
f"<@{user['profile']['display_name_normalized']}>" f"<@{user['profile']['display_name_normalized']}>"