from __future__ import annotations KNOWN_IRC_SERVERS: dict[str, dict[str, int | str | bool]] = { "Libera.Chat": { "host": "irc.libera.chat", "port": 6697, "tls": True, "url": "https://libera.chat/", }, "OFTC": { "host": "irc.oftc.net", "port": 6697, "tls": True, "url": "https://www.oftc.net/", }, "freenode": { "host": "irc.freenode.net", "port": 6697, "tls": True, "url": "https://freenode.net/", }, "Snoonet": { "host": "irc.snoonet.org", "port": 6697, "tls": True, "url": "https://snoonet.org/", }, "IRCCloud": { "host": "irc.irccloud.com", "port": 6697, "tls": True, "url": "https://www.irccloud.com/", }, "Twitch": { "host": "irc.chat.twitch.tv", "port": 6697, "tls": True, "url": "https://dev.twitch.tv/docs/irc/", }, "DALnet": { "host": "irc.dal.net", "port": 6697, "tls": True, "url": "https://www.dal.net/", }, "EFnet": { "host": "irc.efnet.org", "port": 6697, "tls": True, "url": "https://www.efnet.org/", }, "Undernet": { "host": "irc.undernet.org", "port": 6697, "tls": True, "url": "https://www.undernet.org/", }, "Rizon": { "host": "irc.rizon.net", "port": 6697, "tls": True, "url": "https://rizon.net/", }, } def list_known_servers() -> list[dict[str, int | str | bool]]: return [{"name": name, **details} for name, details in KNOWN_IRC_SERVERS.items()] def lookup_server(name: str) -> dict[str, int | str | bool] | None: for server_name, details in KNOWN_IRC_SERVERS.items(): if server_name.lower() == name.lower(): return {"name": server_name, **details} return None def get_default_server() -> dict[str, int | str | bool]: return {"name": "Libera.Chat", **KNOWN_IRC_SERVERS["Libera.Chat"]}