Moved dungeon aliases to json file
This commit is contained in:
parent
202252c177
commit
a78c412eca
22
bot.py
22
bot.py
|
|
@ -19,24 +19,20 @@ bot = commands.Bot(command_prefix='/', intents=intents)
|
||||||
# File to store the LFM logs
|
# File to store the LFM logs
|
||||||
log_file = "lfm_logs.json"
|
log_file = "lfm_logs.json"
|
||||||
|
|
||||||
# Define dungeon aliases
|
# Function to load dungeon aliases from a JSON file
|
||||||
dungeon_aliases = {
|
def load_dungeon_aliases():
|
||||||
"Ara-Kara, City of Echoes": ["ara", "city of echoes", "coe"],
|
with open('dungeon_aliases.json', 'r') as f:
|
||||||
"City of Threads": ["threads", "city of threads", "cot"],
|
return json.load(f)
|
||||||
"The Stonevault": ["stonevault", "vault", "sv"],
|
|
||||||
"The Dawnbreaker": ["dawnbreaker", "breaker", "dawn"],
|
# Load dungeon aliases from the JSON file
|
||||||
"Mists of Tirna Scithe": ["mists", "tirna", "scithe", "mots"],
|
dungeon_aliases = load_dungeon_aliases()
|
||||||
"The Necrotic Wake": ["nw", "necrotic wake", "necrotic"],
|
|
||||||
"Siege of Boralus": ["siege", "boralus", "sob"],
|
|
||||||
"Grim Batol": ["grim", "batol", "gb", "gib tatol"]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Reverse the dictionary for easier lookup
|
# Reverse the dictionary for easier lookup
|
||||||
dungeon_lookup = {}
|
dungeon_lookup = {}
|
||||||
for full_name, aliases in dungeon_aliases.items():
|
for full_name, aliases in dungeon_aliases.items():
|
||||||
for alias in aliases:
|
for alias in aliases:
|
||||||
dungeon_lookup[alias] = full_name
|
dungeon_lookup[alias.lower()] = full_name
|
||||||
|
|
||||||
# Load or create the JSON log file
|
# Load or create the JSON log file
|
||||||
def load_lfm_logs():
|
def load_lfm_logs():
|
||||||
if not os.path.exists(log_file):
|
if not os.path.exists(log_file):
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"Ara-Kara, City of Echoes": ["ara", "city of echoes", "coe"],
|
||||||
|
"City of Threads": ["threads", "city of threads", "cot"],
|
||||||
|
"The Stonevault": ["stonevault", "vault"],
|
||||||
|
"The Dawnbreaker": ["dawnbreaker", "breaker"],
|
||||||
|
"Mists of Tirna Scithe": ["mists", "tirna", "scithe", "mots"],
|
||||||
|
"The Necrotic Wake": ["nw", "necrotic wake", "necrotic"],
|
||||||
|
"Siege of Boralus": ["siege", "boralus", "sob"],
|
||||||
|
"Grim Batol": ["grim", "batol", "gb"]
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue