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
|
||||
log_file = "lfm_logs.json"
|
||||
|
||||
# Define dungeon aliases
|
||||
dungeon_aliases = {
|
||||
"Ara-Kara, City of Echoes": ["ara", "city of echoes", "coe"],
|
||||
"City of Threads": ["threads", "city of threads", "cot"],
|
||||
"The Stonevault": ["stonevault", "vault", "sv"],
|
||||
"The Dawnbreaker": ["dawnbreaker", "breaker", "dawn"],
|
||||
"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", "gib tatol"]
|
||||
}
|
||||
# Function to load dungeon aliases from a JSON file
|
||||
def load_dungeon_aliases():
|
||||
with open('dungeon_aliases.json', 'r') as f:
|
||||
return json.load(f)
|
||||
|
||||
# Load dungeon aliases from the JSON file
|
||||
dungeon_aliases = load_dungeon_aliases()
|
||||
|
||||
# Reverse the dictionary for easier lookup
|
||||
dungeon_lookup = {}
|
||||
for full_name, aliases in dungeon_aliases.items():
|
||||
for alias in aliases:
|
||||
dungeon_lookup[alias] = full_name
|
||||
|
||||
dungeon_lookup[alias.lower()] = full_name
|
||||
|
||||
# Load or create the JSON log file
|
||||
def load_lfm_logs():
|
||||
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