mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Add slash command to send links, add normal commands for study guides & links
This commit is contained in:
parent
9819e82638
commit
0165700d9f
6 changed files with 74 additions and 3 deletions
16
data/links.py
Normal file
16
data/links.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import json
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def load_all_links() -> dict[str, str]:
|
||||
with open("files/links.json", "r") as file:
|
||||
return json.load(file)
|
||||
|
||||
|
||||
def get_link_for(name: str) -> Optional[str]:
|
||||
links = load_all_links()
|
||||
for link in links:
|
||||
if link.lower() == name.lower():
|
||||
return links[link]
|
||||
|
||||
return None
|
||||
Loading…
Add table
Add a link
Reference in a new issue