feat: add dashboard ping button and .env file support
Add a "Send IRC Message" section to the admin dashboard that sends a configurable privmsg to any IRC nick or channel via all connected bots. New POST /admin/ping endpoint broadcasts a "privmsg" WebSocket message type, handled by both Limnoria and Sopel plugins. Also enable pydantic-settings .env file loading (python-dotenv) and add .env.example documenting all NTR_* configuration variables. Made-with: Cursor
This commit is contained in:
@@ -185,6 +185,10 @@ class NtrPlaylist(callbacks.Plugin):
|
||||
msg = ircmsgs.privmsg(channel, data["message"])
|
||||
self._irc.queueMsg(msg)
|
||||
LOGGER.info("Announced to %s: %s", channel, data["message"])
|
||||
elif data.get("type") == "privmsg" and "target" in data and "message" in data:
|
||||
msg = ircmsgs.privmsg(data["target"], data["message"])
|
||||
self._irc.queueMsg(msg)
|
||||
LOGGER.info("Sent privmsg to %s: %s", data["target"], data["message"])
|
||||
elif data.get("type") == "status":
|
||||
LOGGER.info(
|
||||
"Status update: %d bot(s) connected, clients=%s",
|
||||
|
||||
Reference in New Issue
Block a user