From 85c81d3c6c39dd0cca585ce240233badd6b3873e Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Thu, 15 Feb 2024 20:46:39 -0600 Subject: [PATCH] Various tweaks and improvements (2.0.9) --- commands.py | 21 ++++++++++++++++----- config.py | 2 +- handlers.py | 3 +-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/commands.py b/commands.py index 988d57e..668c69a 100644 --- a/commands.py +++ b/commands.py @@ -6,6 +6,13 @@ from typing import Any, Callable import bare, re, checks +def fpmp(bot: bare.bot, chan: str, name: str, message: str) -> None: + bot.msg("Firepup's master playlist", chan) + bot.msg("https://open.spotify.com/playlist/4ctNy3O0rOwhhXIKyLvUZM", chan) + +def version(bot: bare.bot, chan: str, name: str, message: str) -> None: + bot.msg("Version: " + bot.__version__, chan) + def goat(bot: bare.bot, chan: str, name: str, message: str) -> None: bot.log("GOAT DETECTED") bot.msg("Hello Goat", chan) @@ -105,7 +112,7 @@ def quote(bot: bare.bot, chan: str, name: str, message: str) -> None: if q == []: q = [f'No results for "{query}" '] sel = conf.decode_escapes( - str(r.sample(q, 1)).strip("[]'").replace("\\n", "").strip('"') + str(r.sample(q, 1)).strip("[]'").replace("\\n", "") ) bot.msg(sel, chan) @@ -177,17 +184,19 @@ data: dict[str, dict[str, Any]] = { "restart": {"prefix": True, "aliases": ["reboot"], "check": checks.admin}, "uptime": {"prefix": True, "aliases": []}, "raw ": {"prefix": True, "aliases": ["cmd "], "check": checks.admin}, - "debug": {"prefix": True, "aliases": ["dbg"], "check": checks.admin}, + "debug": {"prefix": True, "aliases": ["dbg","d"], "check": checks.admin}, "8ball": {"prefix": True, "aliases": ["eightball", "8b"]}, "join ": {"prefix": True, "aliases": [], "check": checks.admin}, "quote": {"prefix": True, "aliases": ["q"]}, - "goat.mode.activate": {"prefix": True, "aliases": [], "check": checks.admin}, - "goat.mode.deactivate": {"prefix": True, "aliases": [], "check": checks.admin}, - "help": {"prefix": True, "aliases": []}, + "goat.mode.activate": {"prefix": True, "aliases": ["g.m.a"], "check": checks.admin}, + "goat.mode.deactivate": {"prefix": True, "aliases": ["g.m.d"], "check": checks.admin}, + "help": {"prefix": True, "aliases": ["?"]}, "amiadmin": {"prefix": True, "aliases": []}, "ping": {"prefix": True, "aliases": []}, "op me": {"prefix": False, "aliases": [], "check": checks.admin}, "whoami": {"prefix": True, "aliases": []}, + "fpmp": {"prefix": True, "aliases": []}, + "version": {"prefix": True, "aliases": ["ver","v"]}, } regexes: list[str] = [conf.npbase, conf.su] call: dict[str, Callable[[bare.bot, str, str, str], None]] = { @@ -210,4 +219,6 @@ call: dict[str, Callable[[bare.bot, str, str, str], None]] = { "ping": ping, "op me": op, "whoami": whoami, + "fpmp": fpmp, + "version": version, } diff --git a/config.py b/config.py index 38aa238..dbda7e4 100644 --- a/config.py +++ b/config.py @@ -6,7 +6,7 @@ from typing import Optional, Any import bare load_dotenv() -__version__ = "v2.0.6" +__version__ = "v2.0.9" npbase: str = "\[\x0303last\.fm\x03\] [A-Za-z0-9_[\]{}\\|\-^]{1,$MAX} (is listening|last listened) to: \x02.+ - .*\x02( \([0-9]+ plays\)( \[.*\])?)?" # pyright: ignore [reportInvalidStringEscapeSequence] su = "^(su|sudo|(su .*|sudo .*))$" servers: dict[str, dict[str, Any]] = { diff --git a/handlers.py b/handlers.py index 2200bae..911fd07 100644 --- a/handlers.py +++ b/handlers.py @@ -50,7 +50,7 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str] bot.current = "user" if ( (name.startswith("saxjax") and bot.server == "efnet") - or (name == "ReplIRC" and bot.server == "replirc") + or (name in ["ReplIRC", "sshchat"] and bot.server == "replirc") or ( name in ["FirePyLink_", "FirePyLink"] and bot.server in ["ircnow", "backupbox"] @@ -144,7 +144,6 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str] str(r.sample(mm.readlines(), 1)) .strip("[]'") .replace("\\n", "") - .strip('"') ) bot.msg(f"[QUOTE] {sel}", chan) return None, None